Compare commits
No commits in common. "acd7edb9edcd6181551a48560151b4f2d4225b5d" and "4cfb249dd9d0965224231a451dc265c0077b95cb" have entirely different histories.
acd7edb9ed
...
4cfb249dd9
58
src/cube.rs
58
src/cube.rs
@ -55,4 +55,60 @@ pub fn create_vertices() -> (Vec<Vertex>, Vec<u16>) {
|
|||||||
];
|
];
|
||||||
|
|
||||||
(vertex_data.to_vec(), index_data.to_vec())
|
(vertex_data.to_vec(), index_data.to_vec())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// OLD
|
||||||
|
/*
|
||||||
|
use std::mem::size_of;
|
||||||
|
|
||||||
|
const CUBE_VERTEX_SIZE: usize = size_of::<f32>() * 10;
|
||||||
|
const CUBE_VERTEX_COUNT: usize = 36;
|
||||||
|
const CUBE_VERTEX_POS_OFFSET: usize = 0;
|
||||||
|
const CUBE_VERTEX_COLOR_OFFSET: usize = size_of::<f32>() * 4;
|
||||||
|
const CUBE_VERTEX_UV_OFFSET: usize = size_of::<f32>() * 8;
|
||||||
|
const CUBE_VERTICES: [f32; 24] = [
|
||||||
|
// float4 position, float4 color, float2 uv
|
||||||
|
1, -1, 1, 1, 1, 0, 1, 1, 0, 1,
|
||||||
|
-1, -1, 1, 1, 0, 0, 1, 1, 1, 1,
|
||||||
|
-1, -1, -1, 1, 0, 0, 0, 1, 1, 0,
|
||||||
|
1, -1, -1, 1, 1, 0, 0, 1, 0, 0,
|
||||||
|
1, -1, 1, 1, 1, 0, 1, 1, 0, 1,
|
||||||
|
-1, -1, -1, 1, 0, 0, 0, 1, 1, 0,
|
||||||
|
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
|
||||||
|
1, -1, 1, 1, 1, 0, 1, 1, 1, 1,
|
||||||
|
1, -1, -1, 1, 1, 0, 0, 1, 1, 0,
|
||||||
|
1, 1, -1, 1, 1, 1, 0, 1, 0, 0,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
|
||||||
|
1, -1, -1, 1, 1, 0, 0, 1, 1, 0,
|
||||||
|
|
||||||
|
-1, 1, 1, 1, 0, 1, 1, 1, 0, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, -1, 1, 1, 1, 0, 1, 1, 0,
|
||||||
|
-1, 1, -1, 1, 0, 1, 0, 1, 0, 0,
|
||||||
|
-1, 1, 1, 1, 0, 1, 1, 1, 0, 1,
|
||||||
|
1, 1, -1, 1, 1, 1, 0, 1, 1, 0,
|
||||||
|
|
||||||
|
-1, -1, 1, 1, 0, 0, 1, 1, 0, 1,
|
||||||
|
-1, 1, 1, 1, 0, 1, 1, 1, 1, 1,
|
||||||
|
-1, 1, -1, 1, 0, 1, 0, 1, 1, 0,
|
||||||
|
-1, -1, -1, 1, 0, 0, 0, 1, 0, 0,
|
||||||
|
-1, -1, 1, 1, 0, 0, 1, 1, 0, 1,
|
||||||
|
-1, 1, -1, 1, 0, 1, 0, 1, 1, 0,
|
||||||
|
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
|
||||||
|
-1, 1, 1, 1, 0, 1, 1, 1, 1, 1,
|
||||||
|
-1, -1, 1, 1, 0, 0, 1, 1, 1, 0,
|
||||||
|
-1, -1, 1, 1, 0, 0, 1, 1, 1, 0,
|
||||||
|
1, -1, 1, 1, 1, 0, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
|
||||||
|
|
||||||
|
1, -1, -1, 1, 1, 0, 0, 1, 0, 1,
|
||||||
|
-1, -1, -1, 1, 0, 0, 0, 1, 1, 1,
|
||||||
|
-1, 1, -1, 1, 0, 1, 0, 1, 1, 0,
|
||||||
|
1, 1, -1, 1, 1, 1, 0, 1, 0, 0,
|
||||||
|
1, -1, -1, 1, 1, 0, 0, 1, 0, 1,
|
||||||
|
-1, 1, -1, 1, 0, 1, 0, 1, 1, 0,
|
||||||
|
];
|
||||||
|
*/
|
Loading…
Reference in New Issue
Block a user