Display two textured triangles in 3D

This commit is contained in:
2022-10-16 22:57:32 +02:00
parent 238052c8a8
commit ea07e78b18
3 changed files with 26 additions and 10 deletions
+8 -8
View File
@@ -60,47 +60,47 @@ pub fn load_ground(display: &Display) -> VertexBufferAny {
struct Vertex {
position: [f32; 3],
normal: [f32; 3],
texture: [f32; 2],
tex_coords: [f32; 2],
}
implement_vertex!(Vertex, position, normal, texture);
implement_vertex!(Vertex, position, normal, tex_coords);
let mut vertex_data = Vec::new();
vertex_data.push(Vertex {
position: [0.0, 0.0, 0.0],
normal: [0.0, 0.0, 1.0],
texture: [0.0, 0.0],
tex_coords: [0.0, 0.0],
});
vertex_data.push(Vertex {
position: [1.0, 0.0, 0.0],
normal: [0.0, 0.0, 1.0],
texture: [0.0, 0.0],
tex_coords: [1.0, 0.0],
});
vertex_data.push(Vertex {
position: [0.0, 0.0, 1.0],
normal: [0.0, 0.0, 1.0],
texture: [0.0, 0.0],
tex_coords: [0.0, 1.0],
});
vertex_data.push(Vertex {
position: [1.0, 0.0, 0.0],
normal: [0.0, 0.0, 1.0],
texture: [0.0, 0.0],
tex_coords: [1.0, 0.0],
});
vertex_data.push(Vertex {
position: [0.0, 0.0, 1.0],
normal: [0.0, 0.0, 1.0],
texture: [0.0, 0.0],
tex_coords: [0.0, 1.0],
});
vertex_data.push(Vertex {
position: [1.0, 0.0, 1.0],
normal: [0.0, 0.0, 1.0],
texture: [0.0, 0.0],
tex_coords: [1.0, 1.0],
});
/*for object in data.objects.iter() {