|
Before leaping off a huge cliff and trying to dive into complex sections of 3D, we'll start with some basics here. Everything I describe is in reference to an OpenGL style renderer.
The Axis
The center of all the axis is called the origin, denoted as the vector (0,0,0)
3D points (vertices) appear an different (x,y,z) positions on the axis
and connect with each other to form faces/triangles/polygons.
Rotation
Imagine the axis to be like poles that you rotate around, based on their orientation.
The second and third axis figures show what the axis look like after rotating the Y-axis to a certain amount; it changes the orientation. The rotations take place around the zero of the axis you're using. Look at the arrow point on the ends of the x and z axis to see what I mean. If you would like local rotations, rotate first, then translate.
3D Vectors
Every point/vertex comes from a 3D vector, denoted as (x,y,z).
There are many functions associated with 3D Vectors than can be very helpful, such as the Dot Product and Cross Product.
Another helpful function for vectors is linear interpolation (LERP), v1+(v2-v1)*s, where s is a fraction from 0 to 1.
Dot Product - Returns the cosine of the angle between two vectors.
Cross Product - Returns a vector perpindicular to two vectors.
Matrices
Going in a straight line, a1,a2,a3,a4 together are in column 1
a1,a5,a9,a13 are in row 1
Matrices are commonly used with cameras and bones (animation). a13.a14,a15 are for positions X,Y,Z, respectively.
Excluding the positions, rows 1,2,3 are all used for rotations. I will not be going to any math operations here, there are plenty of sites which can explain concepts better than me.
After finishing here, take a look at the first lesson to begin with OpenGL initalization on the DS.
|