summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-10-26 20:27:44 +1100
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-10-26 20:27:44 +1100
commitc9f28052d9b842490aee76d280e27dcb762536b6 (patch)
tree796a26453dd0bea90b0be90cfce91424c031573d
parentd900e713c8aebcc0a56eb594007de62584d470ea (diff)
remove test mat mult
-rw-r--r--examples/cube.c33
1 files changed, 3 insertions, 30 deletions
diff --git a/examples/cube.c b/examples/cube.c
index 8fd85de..cf64370 100644
--- a/examples/cube.c
+++ b/examples/cube.c
@@ -20,15 +20,14 @@ void draw() {
f32 angle_degrees = glfwGetTime() * 45.0;
f32 angle = angle_degrees * PI / 180.0;
- // Move origin to cube center
+ // move origin to cube center
vec3 center_offset = vec3(0.5, 0.5, 0.5);
mat4 to_center = mat4_translation(vec3_negate(center_offset));
mat4 from_center = mat4_translation(center_offset);
- // Create rotation around Y axis
mat4 rotation = mat4_rotation(quat_from_axis_angle(VEC3_Y, angle, true));
- // Print debug info for one frame
+ // print debug info for one frame
static bool printed = false;
if (!printed) {
printf("\nTo Center:\n");
@@ -38,7 +37,7 @@ void draw() {
printed = true;
}
- // Order: first move to center, then rotate, then move back
+ // first move to center, then rotate, then move back
mat4 cube_transform = mat4_mult(from_center, mat4_mult(rotation, to_center));
mat4 move = mat4_translation(vec3(-0.5, -0.5, 0));
@@ -63,33 +62,7 @@ void draw() {
ral_encoder_finish_and_submit(enc);
}
-void test_matrix_mult() {
- // Create a simple translation matrix (1 unit in x)
- mat4 trans1 = mat4_translation(vec3(1, 0, 0));
- // Create another translation matrix (1 unit in y)
- mat4 trans2 = mat4_translation(vec3(0, 1, 0));
-
- printf("Matrix 1 (translate x+1):\n");
- for (int i = 0; i < 16; i += 4) {
- printf("%f %f %f %f\n", trans1.data[i], trans1.data[i + 1], trans1.data[i + 2], trans1.data[i + 3]);
- }
-
- printf("\nMatrix 2 (translate y+1):\n");
- for (int i = 0; i < 16; i += 4) {
- printf("%f %f %f %f\n", trans2.data[i], trans2.data[i + 1], trans2.data[i + 2], trans2.data[i + 3]);
- }
-
- mat4 result = mat4_mult(trans1, trans2);
-
- printf("\nResult matrix:\n");
- for (int i = 0; i < 16; i += 4) {
- printf("%f %f %f %f\n", result.data[i], result.data[i + 1], result.data[i + 2], result.data[i + 3]);
- }
-}
-
int main() {
- test_matrix_mult();
- // exit(1);
core_bringup("Celeritas Example: Triangle", NULL);