Day 6 - Flipping Cone
Today was my first step into playing around with 3D shapes. I’m not entirely sure what I’m doing with them yet (why can’t I change its position on the canvas?!), but I learned a few more basics including frameRate and Rotate and Mouse inputs to stop and start the drawing loop. This sketch is pretty basic, but I like how, when you turn the background off inside the drawing, you get to see the lines of the cone as it rotates and the shape it leaves behind. That was a fun surprise!
Also, as a note, you may have noticed that I didn’t post the last couple days. I’ve decided to keep the challenge to weekdays only to allow myself to dive deeper into new concepts on the weekend, or just properly rest! I figure it couldn’t hurt to space the project out a bit longer as well, as I have to believe the sketches are only going to get more complex as we go.
Code:
function setup() { createCanvas(700, 700, WEBGL); background(250,200,200); frameRate(10); } function draw() { fill(250,200,200); rotateY(millis(1000) / 2000); rotateZ(millis(1000) / 2000); cone(100,300,20); } function mousePressed() { noLoop(); } function mouseReleased() { loop(); }