Unity Courses Custom Mesh Polyhedra in Unity
Unity

Custom Mesh Polyhedra in Unity

Generate regular polygons procedurally in Unity using custom meshes, apply UV mapping for textured shading, and preview the geometry live in the editor.

3 chapters · 15m Beginner Updated 22 Jan 2022 Phil · @FirnoxGames
Free

Free for everyone. No account needed.

Start watching →

What you'll learn

1 Part 1: Creating regular polygons with custom meshes ▶ 4 min

The only polygons that Unity provides built-in are quads.

In this chapter
  1. Introduction
  2. Polygon properties
  3. Unity components needed
  4. Vertex locations
  5. Triangulation of regular polygons
  6. Ending notes
2 Part 2: UV mapping the polygons ▶ 5 min

In the previous video we showed how to create any n-sided regular convex polygon in Unity at runtime using a custom mesh.

In this chapter
  1. Introduction
  2. Outline of mapping process
  3. Modifying the vertex equation for the UV
  4. Modifying the code
  5. Extending to a texture sheet
3 Part 3: Previewing in Edit mode (ExecuteAlways + OnValidate) ▶ 6 min

We extend our custom mesh code to enable us to see the results in Unity when in edit mode by using the ExecuteAlways attribute, and the OnValidate function.

Included with this course
Video walkthrough · 15m
</>Annotated source code ↗ · public domain