The wikipedia article says the coordinates are
- (1, 1, 1)
(−1, −1, 1)
(−1, 1, −1)
(1, −1, −1)
Code: Select all
vertices[0].Pos = core::vector3df(halfSize, halfSize, halfSize);
vertices[1].Pos = core::vector3df(-halfSize, -halfSize, halfSize);
vertices[2].Pos = core::vector3df(-halfSize, halfSize, -halfSize);
vertices[3].Pos = core::vector3df(halfSize, -halfSize, -halfSize);
const u16 indices[12] = { 0, 1, 3, 0, 3, 2, 0, 2, 1, 3, 1, 2 };
Now i want to have the tetrahedron rotated, so that one corner points up the Y-axis. The centroid should be at (0.0f, 0.0f, 0.0f).
So i tried
Code: Select all
vertices[0].Pos = core::vector3df(0.0f, halfSize, 0.0f);
vertices[1].Pos = core::vector3df(-halfSize, -halfSize, -halfSize);
vertices[2].Pos = core::vector3df(halfSize, -halfSize, -halfSize);
vertices[3].Pos = core::vector3df(0.0f, -halfSize, halfSize);
I know i could just rotate the node, but i really want to know the position of the vertices.
The formulas for regular tetrahedron in the article don't help, since my math skills are... uhm.. poor.
Can anyone help?