diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-03-17 15:52:56 +1100 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-03-17 15:52:56 +1100 |
commit | 8c331ac497d6e6705cde5e292538d4ab7d9a16ec (patch) | |
tree | 99a256bd8cf82f02c498b73f9c04adb9a70c92cf /examples | |
parent | cbcd40391c445afb836217a64e0bd96bc54cb805 (diff) |
MOVE
Diffstat (limited to 'examples')
-rw-r--r-- | examples/transforms/ex_transforms.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/transforms/ex_transforms.c b/examples/transforms/ex_transforms.c index b11fbc7..a3bede7 100644 --- a/examples/transforms/ex_transforms.c +++ b/examples/transforms/ex_transforms.c @@ -51,18 +51,16 @@ int main() { transform_node* root_node = transform_hierarchy_root_node(transform_tree); // Add nodes // -- 4 cubes - transform cube1 = transform_create(vec3(1.0, 1.0, 0.0), quat_ident(), 2.0); - transform cube2 = transform_create(vec3(1.0, -1.0, 0.0), quat_ident(), 2.0); - transform cube3 = transform_create(vec3(0.0, 1.0, 0.0), quat_ident(), 2.0); - transform cube4 = transform_create(vec3(0.0, -1.0, 0.0), quat_ident(), 2.0); + transform cube1 = transform_create(vec3(0.0, -2.0, 0.0), quat_ident(), 0.8); + transform cube2 = transform_create(vec3(0.0, 1.0, 0.0), quat_ident(), 1.0); + transform cube3 = transform_create(vec3(0.0, 1.0, 0.0), quat_ident(), 1.0); + transform cube4 = transform_create(vec3(0.0, 1.0, 0.0), quat_ident(), 1.0); transform_node* node1 = transform_hierarchy_add_node(root_node, cube_handle, cube1); - transform_node* node2 = transform_hierarchy_add_node(root_node, cube_handle, cube2); - - transform_node* node3 = transform_hierarchy_add_node(node1, cube_handle, cube3); - transform_node* node4 = transform_hierarchy_add_node(node2, cube_handle, cube4); + transform_node* node2 = transform_hierarchy_add_node(node1, cube_handle, cube2); + transform_node* node3 = transform_hierarchy_add_node(node2, cube_handle, cube3); + transform_node* node4 = transform_hierarchy_add_node(node3, cube_handle, cube4); transform_hierarchy_debug_print(root_node, core); - // Main loop while (!glfwWindowShouldClose(core->renderer.window)) { @@ -72,6 +70,8 @@ int main() { render_frame_begin(&core->renderer); transform_hierarchy_propagate_transforms(transform_tree); + node1->tf.position.x += 0.002; + node1->tf.is_dirty = true; draw_model(&core->renderer, &cam, cube, &node1->world_matrix_tf, &our_scene); draw_model(&core->renderer, &cam, cube, &node2->world_matrix_tf, &our_scene); draw_model(&core->renderer, &cam, cube, &node3->world_matrix_tf, &our_scene); |