ianmackenzie / elm-3d-camera / Triangle3d.Projection

toScreenSpace : Camera3d worldUnits worldCoordinates -> Rectangle2d screenUnits screenCoordinates -> Triangle3d worldUnits worldCoordinates -> Triangle2d screenUnits screenCoordinates

Project a triangle from 3D world to 2D screen coordinates. Equivalent to calling Point3d.toScreenSpace on the three vertices of the triangle.

isFrontFacing : Camera3d units coordinates -> Triangle3d units coordinates -> Basics.Bool

Check if a given triangle is front facing with respect to the given camera. A 'front facing' triangle has a normal direction towards the camera instead of away. This also means that when projected into 2D, the vertices of the triangle will be in counterclockwise order.