ianmackenzie / elm-3d-scene

A high-level 3D rendering engine for Elm, with support for lighting, shadows, and realistic materials.
https://package.elm-lang.org/packages/ianmackenzie/elm-3d-scene/latest/
Mozilla Public License 2.0
207 stars 27 forks source link

Add level of detail handling #23

Open ianmackenzie opened 5 years ago

ianmackenzie commented 5 years ago

Perhaps something like

Drawable.withLevelsOfDetail
    [ { accuracy = millimeters 1, drawable = ... }
    , { accuracy = millimeters 5, drawable = ... }
    , { accuracy = millimeters 10, drawable = ... }
    ]

and then the correct drawable would be chosen based on the current camera position. Note that the near clip distance of the camera can be used as a lower bound for how close the object can be to the viewer, to help determine required accuracy in world units based on desired accuracy in pixels!