Module Matrices
#include <macawgpu.h>A matrix is a grid of 16 numbers that moves, turns, grows or projects every corner you draw. There are two: "modelview" places things in front of the camera, and "projection" turns 3D into the flat picture. The calls below change whichever one gpu_matrixmode picked.
Functions
- gpu_matrixmode
- Picks which matrix the matrix calls after it change.
- gpu_loadidentity
- Resets the current matrix so it changes nothing.
- gpu_pushmatrix
- Saves a copy of the current matrix, so you can change it and get the saved one back with
gpu_popmatrix. - gpu_popmatrix
- Gets back the matrix you last saved with
gpu_pushmatrix. - gpu_translate
- Moves everything you draw after it.
- gpu_rotate
- Turns everything you draw after it round an axis, anticlockwise when you look along the axis towards the middle.
- gpu_scale
- Grows or shrinks everything you draw after it.
- gpu_perspective
- Sets up a perspective projection, where far things look smaller.
- gpu_ortho
- Sets up a flat projection, where things stay the same size however far away they are.
- gpu_frustum
- Sets up a perspective projection by where its edges are.
- gpu_lookat
- Points the camera from an eye at a target.
- gpu_loadmatrix
- Replaces the current matrix with 16 numbers of your own.
- gpu_multmatrix
- Multiplies the current matrix by 16 numbers of your own, as
gpu_translateand the others do with theirs. - gpu_getmatrix
- Copies a matrix out, so you can keep it or work with it.
- gpu_project
- Works out where a point in your 3D world lands in the window, with the matrices as they are now.