Space Walk Turn Ray Tracing On/OFF
What's new:

    I created a little figure that can walk. First, press "Fullscreen" button. In fullscreen mode, the figure is able to walk in four directions when pressing corresponding arrow keys.
     I added normal calculation to every shape I created and then I added phong shading to the scene.
     As before, you can rotate the scene by dragging on the canvas.
    I added new shapes such as torus and cubes.
    If you found the scene somehow clipped, it seems to be a bug of chromium, please simply click on 'Super Sampling' button or refresh the page. .


How it works:

I used the matrix stack to push and pop transformations to create the figure and move it around. The entire scene is then transformed to apply movements and global rotations.
The mesh creation functions and transformation methods are implemented in lib4.header.js
Animating function and are in lib4.ext.js
shader.vert is the vertex shader.
lib4.js most contains initialization methods for the renderer. You can also see how I passes more attributes like surface normal and object id to the shaders.
index.html is almost pure html.