Skip to main content
100%

Gist d458751b92cc86c44bc44f8540a8b29b

✓ Published0🌍 Public
Aandybak
Last edited Feb 8, 2018
Created on Feb 8, 2018

This example displays a tetrahedron built from four triangular faces, with each face defined by three vertices and connected to form a closed 3D shape. The code uses Unity’s MeshFilter and MeshRenderer components, creating a new Mesh object and assigning vertex positions and triangle indices manually. It computes the geometry using vector math, including square roots for equilateral triangle proportions, then calls RecalculateNormals and RecalculateBounds to prepare the mesh for rendering. The script runs in edit mode via ExecuteInEditMode, so the tetrahedron appears immediately in the Unity editor without requiring playback.

AI-generated description

Similar vizzes