gfx-rs / genmesh

A library of mesh generation utilities.
Apache License 2.0
122 stars 29 forks source link

Cube SharedVertex/IndexedPolygon creates 24 vertices #52

Closed Rhuagh closed 7 years ago

Rhuagh commented 7 years ago

Shouldn't it create only 8 vertices?

kvark commented 7 years ago

No, because while we have 8 unique positions, the normals are different per face. Supporting a cube generator without normals / tex-coords could be useful, but three-rs in particular doesn't need it, and it's a main client of genmech.

Rhuagh commented 7 years ago

I guess that's true, I just couldn't find a use case for individual normals per vertex per face. Didn't think of texture coordinates.

Rhuagh commented 7 years ago

And I thought SharedVertex was for emitting shared vertices?

kvark commented 7 years ago

I just couldn't find a use case for individual normals per vertex per face

If you need normals at all, then how do you see them not being individual per face of a cube?

And I thought SharedVertex was for emitting shared vertices?

Shared vertices != shared positions

Rhuagh commented 7 years ago

I come from collision/geometry, I tend to forget graphics things :) In geometry you only need the face normals or the vertex normals, you don't need to duplicate the face normal for each vertex.

Anyways, I understand now.