From e69f05739e56d62361e5bb0dcc4db17289b0c2df Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 17 Jan 2025 19:20:22 +0100 Subject: chore: replace cube obj with generated cube mesh --- src/main.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index a982dbb..3055e28 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,6 +17,10 @@ use engine::file_format::wavefront::obj::parse as parse_obj; use engine::input::Extension as InputExtension; use engine::lighting::{AttenuationParams, GlobalLight, PointLight}; use engine::material::{Builder as MaterialBuilder, Flags as MaterialFlags}; +use engine::mesh::cube::{ + create as cube_mesh_create, + CreationSpec as CubeMeshCreationSpec, +}; use engine::renderer::opengl::Extension as OpenglRendererExtension; use engine::transform::Position; use engine::vector::Vec3; @@ -82,8 +86,14 @@ fn main() -> Result<(), Box> }) .build(), Position::from(Vec3 { x: -6.0, y: 3.0, z: 3.0 }), - parse_obj(&read_to_string(Path::new(RESOURCE_DIR).join("cube.obj"))?)? - .to_mesh()?, + cube_mesh_create( + CubeMeshCreationSpec::builder() + .width(2.0) + .height(2.0) + .depth(2.0) + .build(), + |face_verts, _, _| face_verts, + ), MaterialBuilder::new().ambient(YELLOW * 5.0).build(), MaterialFlags::builder().use_ambient_color(true).build(), )); -- cgit v1.2.3-18-g5258