davepagurek / GLExplore

GL tests
2 stars 0 forks source link

Improve surface normal calculations #20

Open abhimadan opened 7 years ago

abhimadan commented 7 years ago

After #19 is merged, it would be good to improve the way we compute normals for different types of geometries. We can augment a vector of points with some enum to indicate what type of mesh it is. For example, we can make simple, creased meshes like cubes to be triangular meshes, and smooth meshes like the Perlin noise hill to be quad meshes. Based on this information, we can compute normals differently. We currently treat everything as a triangular mesh, so we just need to add quad mesh normal logic.

davepagurek commented 7 years ago

This would also let us pass in a vertex array and index list, which is slightly nicer than what we have right now