KallistiOS
##version##
|
3D matrix operations. More...
Go to the source code of this file.
Functions | |
void | mat_rotate_x (float r) |
Rotate around the X-axis. More... | |
void | mat_rotate_y (float r) |
Rotate around the Y-axis. More... | |
void | mat_rotate_z (float r) |
Rotate around the Z-axis. More... | |
void | mat_rotate (float xr, float yr, float zr) |
Rotate around all axes. More... | |
void | mat_translate (float x, float y, float z) |
Perform a 3D translation. More... | |
void | mat_scale (float x, float y, float z) |
Perform a 3D scale operation. More... | |
void | mat_perspective (float xcenter, float ycenter, float cot_fovy_2, float znear, float zfar) |
Set up a perspective view frustum. More... | |
void | mat_lookat (const point_t *eye, const point_t *center, const vector_t *up) |
Set up a "camera". More... | |
3D matrix operations.
This file contains various 3D matrix math functionality for using the SH4's matrix transformation unit.
Set up a "camera".
This function acts as the similarly named GL function to set up a "camera" by doing rotations/translations.
eye | The eye coordinate. |
center | The center coordinate. |
up | The up vector. |
void mat_perspective | ( | float | xcenter, |
float | ycenter, | ||
float | cot_fovy_2, | ||
float | znear, | ||
float | zfar | ||
) |
Set up a perspective view frustum.
This function sets up a perspective view frustum for basic 3D usage.
xcenter | Center of the X direction. |
ycenter | Center of the Y direction. |
cot_fovy_2 | 1.0 / tan(view_angle / 2). |
znear | Near Z-plane. |
zfar | Far Z-plane. |
void mat_rotate | ( | float | xr, |
float | yr, | ||
float | zr | ||
) |
Rotate around all axes.
This function sets up a rotation matrix around the X-axis, then around the Y, then around the Z.
xr | The angle to rotate around the X-axis, in radians. |
yr | The angle to rotate around the Y-axis, in radians. |
zr | The angle to rotate around the Z-axis, in radians. |
void mat_rotate_x | ( | float | r | ) |
Rotate around the X-axis.
This function sets up a rotation matrix around the X-axis.
r | The angle to rotate, in radians. |
void mat_rotate_y | ( | float | r | ) |
Rotate around the Y-axis.
This function sets up a rotation matrix around the Y-axis.
r | The angle to rotate, in radians. |
void mat_rotate_z | ( | float | r | ) |
Rotate around the Z-axis.
This function sets up a rotation matrix around the Z-axis.
r | The angle to rotate, in radians. |
void mat_scale | ( | float | x, |
float | y, | ||
float | z | ||
) |
Perform a 3D scale operation.
This function sets up a scaling matrix with the specified parameters.
x | The ratio to scale in X. |
y | The ratio to scale in Y. |
z | The ratio to scale in Z. |
void mat_translate | ( | float | x, |
float | y, | ||
float | z | ||
) |
Perform a 3D translation.
This function sets up a translation matrix with the specified parameters.
x | The amount to translate in X. |
y | The amount to translate in Y. |
z | The amount to translate in Z. |