In which you will apply vertex attributes, shader programs, and a VAO in order to fill your framebuffers with the dotted outlines of two shapes that can be described algorithmically.
Your first challenge is to construct a random polygon shape from physical construction tools and then digitize it. Complete the following steps to render a frankenshape:
frankenshape
project, run npm install
.
requestAnimationFrame
, like this:
function animateFrame() {
// TODO:
// - use performance.now() to get milliseconds elapsed
// - calculate a smooth, periodic scale factor using the time
// - redraw the scene using the new scale factor
requestAnimationFrame(animateFrame);
}
Your second challenge is to render a tetrahedron that rotates with the mouse. Complete these steps:
tetrahedon
project, run npm install
.
initialize
function:
gl.enable(gl.DEPTH_TEST);