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

WIP: support tangents #13

Open w0rm opened 3 years ago

w0rm commented 3 years ago

Closes #2

This adds support for tangents generation functionality:

normalMappedFaces :
    Obj.Decode.Decoder
        (
        TriangularMesh.TriangularMesh
            { position : Point3d.Point3d Length.Meters coordinates
            , normal : Vector3d.Vector3d Quantity.Unitless coordinates
            , uv : ( Basics.Float, Basics.Float )
            , tangent : Vector3d.Vector3d Quantity.Unitless coordinates
            , tangentBasisIsRightHanded : Basics.Bool
            }
        )

It also introduces an example that uses unpublished elm-3d-scene https://unsoundscapes.com/nefertiti/

Screenshot 2021-05-15 at 09 09 07