Tech News
← Back to articles

Cutting Up Curved Things (With Math)

read original related products more articles

Cutting Up Curved Things

Your GPU doesn't know what a cylinder is.

It knows triangles! That's it. Three points, maybe a color. The entire vocabulary of graphics hardware fits on an index card.

12 triangles. That's all a cube is.

So before any curved surface can be rendered, someone has to chop it into triangles. Lots of them! Arranged just right so the illusion holds.

That's tessellation.

Triangles all the way down

A triangle mesh is just two arrays:

vertices: [x₀, y₀, z₀, x₁, y₁, z₁, x₂, y₂, z₂, ...] indices: [0, 1, 2, 0, 2, 3, ...]

Vertices are points in space, and indices say which three points form each triangle. That's the entire data structure!

... continue reading