The following are screenshots of what the above code codes for.. It is a sphere that once the user moves the mouse cursor along the x and y-axis, it changes its form respectively. The further one goes to the left-hand side of the canvas, the less sides it gets and it becomes a tetrahedron, whereas if the user moves the cursor to the right-hand side of the canvas, the shape becomes a very detailed sphere with a lot of faces. The 'fill' function within the code also changes the colour of the geometry based on the cursors positioning on the x-axis. As you can see, the geometry is based in the top left-hand corner of the canvas, I will not translate it to the centre of the page so no parts of the animation hangs over the edge of the canvas and is not visible. |
No comments:
Post a Comment