Manipulating 3D Objects
You probably remember earlier when I briefly described transformations, or moving from one coordinate system to another, and how I would discuss it more in depth later. Well, it is later now, so it seems like the perfect time to get into it. There are three basic transformations you want to accomplish:
Translation— You can think of translation as actually moving the object. It's essentially adding a new point in 3D space to every vertex in your model to move it to a new location. For example, if you had a single vertex at point (1,2,3) and translated it (-2,3,1), you would calculate the new vertex position by simply adding each of the axis coordinates. In this case, the new vertex would be located at (-1,5,4) after the ...
Get Beginning 3D Game Programming 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.