HTML and CSS Reference
In-Depth Information
} else if (event.keyCode === 38) { //up
offsetY -= 5;
} else if (event.keyCode === 40) { //down
offsetY += 5;
}
points.forEach(function (point) {
point.setCenter(offsetX, offsetY, 200);
});
}, false);
This example can be found in document 12-move-cube-2.html . Now the entire cube moves as a whole
and continues to rotate around its center, but it does not orbit around the center of the scene's 3D
coordinate space.
Summary
With what you learned in this chapter, you should be on your way to modeling your own 3D shapes on and
manipulating them in 3D space.
This chapter concentrated on creating 3D geometry and how to draw the lines and color fills. In the next
chapter, you explore how to create more solid-looking solids. All that material builds on the foundation of
points, lines, and fills that you covered here. So, when you're ready, let's move on!
 
Search WWH ::




Custom Search