3D & WEBGL - Creative Coding
———————————————————————————————————————————————————————
Link: https://editor.p5js.org/Kevin-Lewis-13/sketches/HLmHheCTe
———————————————————————————————————————————————————————
-------------------------—————————————————————
Instructions:
Drag the mouse around the canvas to rotate the center donut & boxes rotating around it.
Dragging the mouse around also moves the directional light of the blank rotating cubes.
-------------------------—————————————————————
Description:
First, I started with the center donut using the normalMaterial since I thought it looked very cool. I had it rotate automatically at first, but then changed it to rotate with the mouse.
Next I wanted to add cubes, and as I was adding cubes, I realized that one of them would perfectly go through the center of the donut, which I thought was awesome, so I added 5 more of them and put a texture of Fry from Futurama, which is one of my favorite shows of all time.
After having the donut and the textured cubes that pass through the middle, I thought about how I should add the light source type of objects. I looked through the directional light reference as a start, then I changed it from a sphere to a cube.
I wanted this cube to not be affected by the donut or mouse, so I used the push and pop functions to keep them as their own objects, and then I put 7 more to create a cube like shape when looking at them while not moving.
Finally, I added movement so that they would rotate around the donut while interesecting with eachother which I thought looked pretty cool.