BLOG.CSHARPHELPER.COM: Draw two interlocked tetrahedrons defined by a cube using WPF and XAML
Draw two interlocked tetrahedrons defined by a cube using WPF and XAML
My post Platonic Solids Part 2: The tetrahedron shows how to calculate the locations of a tetrahedron's vertices. The example Draw two interlocked tetrahedrons using WPF, XAML, and C# uses those vertices to draw two interlocked tetrahedrons.
The vertex calculations are interesting (if you like geometry), but there's an easier way to find the vertices of two interlocked tetrahedrons. You can use the corners of a cube to define the vertices of two interlocked tetrahedrons as shown in the picture on the right.
Much of this example is similar to Draw two interlocked tetrahedrons using WPF, XAML, and C# except it uses the following code to define its tetrahedrons' vertices and faces.
If you look carefully at the vertex coordinates, you can see where they lie on the unit cube. The program uses a ScaleTransform3D to scale the coordinates by a factor of 2.5 in the X, Y, and Z directions to make the tetrahedrons fill the viewing area nicely. Download the example for additional details.
Comments