w0rm / elm-obj-file

Encode and decode 3D geometry in the OBJ file format
https://package.elm-lang.org/packages/w0rm/elm-obj-file/latest
BSD 3-Clause "New" or "Revised" License
24 stars 4 forks source link

Autogenerate tangents #2

Open w0rm opened 4 years ago

w0rm commented 4 years ago

Tangents would allow rendering with normal mapping. Tangent can be calculated from positions and uv of three vertices from a face.

TBD: a tangent probably needs to store an additional value (1 or -1) that is needed to compute the direction of bitangent, so a Vector3d type might not be enough to store the value.

This depends on elm-3d-scene support for normal maps.