ps2sdk
1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
|
Go to the source code of this file.
Calculate colour values given an array of light intensity values.
Definition at line 539 of file math3d.c.
References colours, and vector_clamp().
Referenced by render_teapot().
void calculate_lights | ( | VECTOR * | output, |
int | count, | ||
VECTOR * | normals, | ||
VECTOR * | light_directions, | ||
VECTOR * | light_colours, | ||
int * | light_types, | ||
int | light_count | ||
) |
Calculate the light intensity for an array of lights given an array of normal values.
Definition at line 492 of file math3d.c.
References LIGHT_AMBIENT, light_colour, light_count, light_direction, LIGHT_DIRECTIONAL, light_type, normals, and vector_innerproduct().
Referenced by render_teapot().
Transform an array of normals by applying the specified local_light matrix.
Definition at line 446 of file math3d.c.
References normals.
Referenced by render_teapot().
Calculate vertex values by applying the specific local_screen matrix.
Definition at line 557 of file math3d.c.
References local_screen, and vertices.
Referenced by render(), and render_teapot().
Create a local_light matrix given a rotation. Commonly used to transform an object's normals for lighting calculations.
Definition at line 386 of file math3d.c.
References matrix_rotate(), and matrix_unit().
Referenced by render_teapot().
void create_local_screen | ( | MATRIX | local_screen, |
MATRIX | local_world, | ||
MATRIX | world_view, | ||
MATRIX | view_screen | ||
) |
Create a local_screen matrix given a local_world, world_view and view_screen matrix. Commonly used with vector_apply() to transform vertices for rendering.
Definition at line 434 of file math3d.c.
References local_screen, local_world, matrix_multiply(), matrix_unit(), view_screen, and world_view.
Referenced by draw_cube(), render(), and render_teapot().
Create a local_world matrix given a translation and rotation. Commonly used to describe an object's position and orientation.
Definition at line 377 of file math3d.c.
References local_world, matrix_rotate(), matrix_translate(), and matrix_unit().
Referenced by draw_cube(), render(), and render_teapot().
void create_view_screen | ( | MATRIX | view_screen, |
float | aspect, | ||
float | left, | ||
float | right, | ||
float | bottom, | ||
float | top, | ||
float | near, | ||
float | far | ||
) |
Create a view_screen matrix given an aspect and clipping plane values. Functionally similar to the opengl function: glFrustum()
Definition at line 416 of file math3d.c.
References matrix_unit(), and view_screen.
Referenced by render().
Create a world_view matrix given a translation and rotation. Commonly used to describe a camera's position and rotation.
Definition at line 394 of file math3d.c.
References matrix_rotate(), matrix_translate(), matrix_unit(), and world_view.
Referenced by draw_cube(), render(), and render_teapot().
Copy a matrix.
Definition at line 175 of file math3d.c.
Referenced by matrix_inverse(), and matrix_transpose().
Calculate the inverse of a matrix.
Definition at line 201 of file math3d.c.
References matrix_copy(), and matrix_transpose().
Multiply two matrices together.
Definition at line 219 of file math3d.c.
Referenced by create_local_screen(), matrix_rotate(), matrix_scale(), and matrix_translate().
Create a rotation matrix and apply it to the specified input matrix.
Definition at line 285 of file math3d.c.
References matrix_multiply(), and matrix_unit().
Referenced by create_local_light(), create_local_world(), and create_world_view().
Create a scaling matrix and apply it to the specified input matrix.
Definition at line 314 of file math3d.c.
References matrix_multiply(), and matrix_unit().
Create a translation matrix and apply it to the specified input matrix.
Definition at line 326 of file math3d.c.
References matrix_multiply(), and matrix_unit().
Referenced by create_local_world(), and create_world_view().
Transpose a matrix.
Definition at line 338 of file math3d.c.
References matrix_copy().
Referenced by matrix_inverse().
void matrix_unit | ( | MATRIX | output | ) |
Create a unit matrix.
Definition at line 364 of file math3d.c.
Referenced by create_local_light(), create_local_screen(), create_local_world(), create_view_screen(), create_world_view(), matrix_rotate(), matrix_scale(), and matrix_translate().
Clamp a vector's values by cutting them off at a minimum and maximum value.
Definition at line 50 of file math3d.c.
References max, min, and vector_copy().
Referenced by calculate_colours().
Copy a vector.
Definition at line 73 of file math3d.c.
Referenced by vector_clamp(), and vector_multiply().
Calculate the inner product of two vectors. Returns a scalar value.
Definition at line 87 of file math3d.c.
Referenced by calculate_lights().