Traditionally, we deal with one plane, the XY plane. Now there are the XZ and YZ planes too.
For the purposes of this text, the Z axis goes into/comes out of the screen and the XY plane is the screen. The Y axis is vertical. Just think of the XZ plane as looking down from the top and the XY as looking at the screen. The YZ is a side view. Its not difficult after a bit of programming, because increasing the Y values of things makes them go up on the screen. Changing the Z moves them side to side, etc.
There are 3 basic operations that can be performed on a point:
- Scaling/skewing:
Scaling is the multiplication of the x, y & z locations by a value (usually not 0)
Equation:
x=x*n
y=y*n
z=z*n
Skewing is the multiplication of the x, y & z locations by 3 different values (one for each axis)
Equation:
x=x*nx
y=y*ny
z=z*nz
- Translating (or transforming):
Translating is moving the points.
Each set of points is located in its own coordinate system, called model space. Within model space, points can be manipulated. Changing from model space to world space is known as translation.
Translation equation:
x=x+new_x
y=y+new_y where the point to move to is (new_x,new_y,new_z)
z=z+new_z
- Rotating:
Rotation is the moving of points a specified amount of arc (an arc is a part of the edge of a circle) around a circle on the plane of rotation (x, y or z) with a center at 0, 0, 0.
Rotation is accomplished by appling a form of the circle equation to an axis.
The circle equation is:
x=x*cos(q) - y*sin(q)
y=x*sin(q) + y*cos(q) where q is an angle in radians (covered below)
Note that if we add a z=z equation, we have rotation about the z axis.
Extra: I don't have the proof for this, but you can see why it forms a circle with a graphing calculator
Rotation for y:
x=x*cos(q)+z*sin(q)
y=y
z=-x*sin(q)+z*cos(q)
Rotation for x:
x=x
y=y*cos(q)-z*sin(q)
z=y*sin(q)+z*cos(q)