genmesh icon indicating copy to clipboard operation
genmesh copied to clipboard

Generate texture coordinates

Open kvark opened this issue 9 years ago • 2 comments

kvark avatar May 22 '15 17:05 kvark

This feature appears to me to be the most controversial, for the following reasons:

  1. there is no single way to generate UV unwraps, contrary to how positions and normals are generated
  2. handling UV seams is somewhat difficult/inconvenient from the implementation point of view
  3. users are very sensitive to how exactly UVs are laid out

I vaguely suggest the following solution:

  • separate generator structs from iterators. Thus users will call cube.iter() or cube.iter_uv to get different iterators.
  • don't implement UV for the SharedVertex logic, since it's too much headache, and the users can always use LruIndexer to compute those, if needed. Perhaps, we could have a helper to do this semi-automatically?
  • stick to Three.js UV layout convention. This also sparks the question of vertex positions should follow the same order.

Any opinions? @csherratt @ozkriff @brendanzab

kvark avatar May 29 '17 16:05 kvark

I ran into this problem while using Amethyst. I wouldn't have had a problem if the texture coordinates for a sphere were simply the latitude and longitude scaled to 0..1.

It would be perfectly fine to me to have to write the shape and UV generation myself but it would be useful to have helper functions available for computing tangents etc.

joonazan avatar Feb 02 '20 16:02 joonazan