aboutsummaryrefslogtreecommitdiff
path: root/src/o3d/mesh.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/o3d/mesh.cpp')
-rw-r--r--src/o3d/mesh.cpp44
1 files changed, 29 insertions, 15 deletions
diff --git a/src/o3d/mesh.cpp b/src/o3d/mesh.cpp
index 47a1ea2..bf60cc8 100644
--- a/src/o3d/mesh.cpp
+++ b/src/o3d/mesh.cpp
@@ -6,25 +6,39 @@
using namespace engine::o3d;
-Mesh Mesh::cube() {
+// Mesh Mesh::cube() {
+// return {
+// {
+// { engine::math::Vector3(-1.f, -1.f, -1.f), {} },
+// { engine::math::Vector3(+1.f, -1.f, -1.f), {} },
+// { engine::math::Vector3(-1.f, +1.f, -1.f), {} },
+// { engine::math::Vector3(+1.f, +1.f, -1.f), {} },
+// { engine::math::Vector3(-1.f, -1.f, +1.f), {} },
+// { engine::math::Vector3(+1.f, -1.f, +1.f), {} },
+// { engine::math::Vector3(-1.f, +1.f, +1.f), {} },
+// { engine::math::Vector3(+1.f, +1.f, +1.f), {} },
+// },
+// {
+// { 0, 2, 3 }, { 0, 3, 1 }, // face 1
+// { 0, 4, 6 }, { 0, 6, 2 }, // face 2
+// { 0, 1, 5 }, { 0, 5, 4 }, // face 3
+// { 7, 6, 4 }, { 7, 4, 5 }, // face 4
+// { 7, 3, 2 }, { 7, 2, 6 }, // face 5
+// { 7, 5, 1 }, { 7, 1, 3 }, // face 6
+// }
+// };
+// }
+
+Mesh Mesh::plane() {
return {
{
- { engine::math::Vector3(-1.f, -1.f, -1.f), {} },
- { engine::math::Vector3(+1.f, -1.f, -1.f), {} },
- { engine::math::Vector3(-1.f, +1.f, -1.f), {} },
- { engine::math::Vector3(+1.f, +1.f, -1.f), {} },
- { engine::math::Vector3(-1.f, -1.f, +1.f), {} },
- { engine::math::Vector3(+1.f, -1.f, +1.f), {} },
- { engine::math::Vector3(-1.f, +1.f, +1.f), {} },
- { engine::math::Vector3(+1.f, +1.f, +1.f), {} },
+ { engine::math::Vector3(-1.f, 0.f, -1.f), {0.f, 0.f} },
+ { engine::math::Vector3(+1.f, 0.f, -1.f), {1.f, 0.f} },
+ { engine::math::Vector3(+1.f, 0.f, +1.f), {1.f, 1.f} },
+ { engine::math::Vector3(-1.f, 0.f, +1.f), {0.f, 1.f} },
},
{
- { 0, 2, 3 }, { 0, 3, 1 }, // face 1
- { 0, 4, 6 }, { 0, 6, 2 }, // face 2
- { 0, 1, 5 }, { 0, 5, 4 }, // face 3
- { 7, 6, 4 }, { 7, 4, 5 }, // face 4
- { 7, 3, 2 }, { 7, 2, 6 }, // face 5
- { 7, 5, 1 }, { 7, 1, 3 }, // face 6
+ { 0, 1, 2 }, { 2, 3, 0 },
}
};
}