elm-3d-scene icon indicating copy to clipboard operation
elm-3d-scene copied to clipboard

Add support for automatic texture mapping

Open ianmackenzie opened this issue 4 years ago • 1 comments

To start:

  • Planar (based on a sketch plane)
  • Spherical (based on a frame)
  • Cylindrical (based on a frame)

Would also need a way to specify the texture scale (meters per pixel? texture width? width and height?).

Should likely be implemented as functions that transform a Material - convert one that requires UV coordinates into one that doesn't.

ianmackenzie avatar Feb 07 '20 19:02 ianmackenzie

Perhaps simpler: have some nice helpers for generating UV coordinates when building a mesh, e.g.

Mesh.planarUv : 
    Rectangle3d Meters coordinates
    -> Point3d Meters coordinates
    -> ( Float, Float )

Mesh.sphericalUv : 
    Frame3d Meters coordinates defines
    -> Point3d Meters coordinates
    -> ( Float, Float )

ianmackenzie avatar Feb 13 '20 01:02 ianmackenzie