Concept
I wanted to create a self-avoiding walk and when the walk ended there would be a morphing shape displayed.
Embedded Sketch
Code Highlight
function displayShape() {
background(50);
// Rotate the shape around the y-axis
rotateY(frameCount * 0.05);
// Draw shape using the curve function
fill(167, 250, 250);
curve(-500, 500, 0, 0, 20, 20, 20, 20, 0, 500, 500, 0);
}
Future Improvements
The self-avoiding walk was time-consuming to figure out, and it was my first time using curve(). I had difficulty implementing it into my code as I haven’t worked with “WEBGL”, and thus had to modify my code accordingly. In the future, I want to try to add text to the displayShape screen as well, as I couldn’t figure out how to add it with “WEBGL” interfering.