diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 14 |
1 files changed, 12 insertions, 2 deletions
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<dyn Error>> }) .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(), )); |