mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-11 05:18:26 +00:00
Prepare for follow-on change
This commit is contained in:
parent
3931991aaf
commit
48c7a842a0
@ -1,8 +1,9 @@
|
|||||||
use crate::mesh::Mesh;
|
use crate::mesh::Mesh;
|
||||||
|
|
||||||
pub fn model() -> anyhow::Result<Mesh> {
|
pub fn model() -> anyhow::Result<Mesh> {
|
||||||
Ok(Mesh {
|
let mut mesh = Mesh::default();
|
||||||
vertices: vec![
|
|
||||||
|
[
|
||||||
[-0.5, -0.5, -0.5], // 0
|
[-0.5, -0.5, -0.5], // 0
|
||||||
[0.5, -0.5, -0.5], // 1
|
[0.5, -0.5, -0.5], // 1
|
||||||
[-0.5, 0.5, -0.5], // 2
|
[-0.5, 0.5, -0.5], // 2
|
||||||
@ -11,8 +12,10 @@ pub fn model() -> anyhow::Result<Mesh> {
|
|||||||
[0.5, -0.5, 0.5], // 5
|
[0.5, -0.5, 0.5], // 5
|
||||||
[-0.5, 0.5, 0.5], // 6
|
[-0.5, 0.5, 0.5], // 6
|
||||||
[0.5, 0.5, 0.5], // 7
|
[0.5, 0.5, 0.5], // 7
|
||||||
],
|
]
|
||||||
triangles: vec![
|
.map(|vertex| mesh.vertices.push(vertex));
|
||||||
|
|
||||||
|
[
|
||||||
[0, 4, 6], // left
|
[0, 4, 6], // left
|
||||||
[0, 6, 2],
|
[0, 6, 2],
|
||||||
[1, 3, 7], // right
|
[1, 3, 7], // right
|
||||||
@ -25,6 +28,8 @@ pub fn model() -> anyhow::Result<Mesh> {
|
|||||||
[1, 2, 3],
|
[1, 2, 3],
|
||||||
[4, 5, 7], // top
|
[4, 5, 7], // top
|
||||||
[4, 7, 6],
|
[4, 7, 6],
|
||||||
],
|
]
|
||||||
})
|
.map(|triangle| mesh.triangles.push(triangle));
|
||||||
|
|
||||||
|
Ok(mesh)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user