Chapter 5Orientation
The quintessential setup in three-dimensional graphics is a scene composed of objects with a camera positioned somewhere looking in a particular direction. As a simple example, imagine a single cube sitting on the ground. This is our scene and we look at it from some point in space. We imagine either our eye or perhaps a camera at this point oriented in such a way that it is looking at the scene and probably focused on the cube in particular. There is much that we have to keep track of here. The cube has a given shape, it is positioned on the ground at a particular location with a particular orientation, the camera is centered at a given point, it is looking at some point in the scene, and it is positioned so the up direction is aligned in a way the user or programmer prefers. Our task now is to determine how to specify all of these orientations and how to keep them appropriately aligned with each other as we move the camera or move objects in the scene.
Start with the cube in our example, and note that most of the vector geometry developed so far was focused on determining the vertices for various objects like the cube. We actually want coordinates for these vertices, so we specified a Cartesian coordinate system which we now call the local coordinate system. It is local for the object at hand and usually we find it convenient to place the origin at the center of the object (assuming this center is convenient to find.) When we place the cube on the ground, ...
Get Mathematical Structures for Computer Graphics now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.