diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-06-17 22:08:13 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-06-17 22:08:13 +1000 |
commit | f1cb5bece520dba63fa77e4721909ab8f0a6c26f (patch) | |
tree | 33e0888475fcb10a4857db6d5570fa7cce459cb7 /examples/primitives/ex_primitives.c | |
parent | 9c8ef3cb95cff78bdc9d527b89ba30cf616e18c0 (diff) |
add plane primitive
Diffstat (limited to 'examples/primitives/ex_primitives.c')
-rw-r--r-- | examples/primitives/ex_primitives.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/primitives/ex_primitives.c b/examples/primitives/ex_primitives.c index 2109215..d39c0d1 100644 --- a/examples/primitives/ex_primitives.c +++ b/examples/primitives/ex_primitives.c @@ -30,6 +30,9 @@ int main() { geometry_data sphere_data = geo_create_uvsphere(1.0, 8, 8); mesh sphere = mesh_create(&sphere_data, false); + geometry_data plane_data = geo_create_plane(f32x2(6,4)); + mesh plane = mesh_create(&plane_data, false); + // FIXME: // Texture // texture_data tex_data = texture_data_load("assets/textures/texture.jpg", false); // texture_handle texture = texture_data_upload(tex_data, true); @@ -51,8 +54,10 @@ int main() { mat4 sphere_model = transform_to_mat(&transform); mat4 cube_model = mat4_translation(vec3(-2., 0, 0)); + mat4 plane_model = mat4_translation(vec3(0,-2,0)); draw_mesh(&cube, &cube_model, &cam); draw_mesh(&sphere, &sphere_model, &cam); + draw_mesh(&plane, &plane_model, &cam); render_frame_end(&g_core.renderer); } |