Cutting Up Curved Things (With Math)
campedersen.com·8h·
Discuss: Hacker News
🎨Graphic Design
Preview
Report Post

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!

Every 3D model you’ve ever seen - every game character, every CAD render, every Pixar frame - is just these two arrays, fed to a G…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help