Display two textured triangles in 3D
This commit is contained in:
+8
-8
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user