Copyright | (C) Frank Staals |
---|---|
License | see the LICENSE file |
Maintainer | Frank Staals |
Safe Haskell | None |
Language | Haskell2010 |
Description : Data type to represent a camera and some functions for working with it.
Synopsis
- data Camera r = Camera !(Point 3 r) !(Vector 3 r) !(Vector 3 r) !r !r !r !(Vector 2 r)
- cameraPosition :: forall r. Lens' (Camera r) (Point 3 r)
- rawCameraNormal :: forall r. Lens' (Camera r) (Vector 3 r)
- rawViewUp :: forall r. Lens' (Camera r) (Vector 3 r)
- viewPlaneDepth :: forall r. Lens' (Camera r) r
- nearDist :: forall r. Lens' (Camera r) r
- farDist :: forall r. Lens' (Camera r) r
- screenDimensions :: forall r. Lens' (Camera r) (Vector 2 r)
- cameraNormal :: Floating r => Lens' (Camera r) (Vector 3 r)
- viewUp :: Floating r => Lens' (Camera r) (Vector 3 r)
- cameraTransform :: Fractional r => Camera r -> Transformation 3 r
- worldToView :: Fractional r => Camera r -> Transformation 3 r
- toViewPort :: Fractional r => Camera r -> Transformation 3 r
- perspectiveProjection :: Fractional r => Camera r -> Transformation 3 r
- rotateCoordSystem :: Num r => Camera r -> Transformation 3 r
- flipAxes :: Num r => Transformation 3 r
Documentation
defines a basic camera
viewPlaneDepth :: forall r. Lens' (Camera r) r Source #
cameraNormal :: Floating r => Lens' (Camera r) (Vector 3 r) Source #
Lens to get and set the Camera normal, makes sure that the vector remains normalized.
viewUp :: Floating r => Lens' (Camera r) (Vector 3 r) Source #
Lens to get and set the viewUp vector. Makes sure the vector remains normalized.
cameraTransform :: Fractional r => Camera r -> Transformation 3 r Source #
Full transformation that renders the figure
worldToView :: Fractional r => Camera r -> Transformation 3 r Source #
Translates world coordinates into view coordinates
toViewPort :: Fractional r => Camera r -> Transformation 3 r Source #
Transformation into viewport coordinates
perspectiveProjection :: Fractional r => Camera r -> Transformation 3 r Source #
constructs a perspective projection
rotateCoordSystem :: Num r => Camera r -> Transformation 3 r Source #
Rotates coordinate system around the camera, such that we look in the negative z direction
flipAxes :: Num r => Transformation 3 r Source #
Flips the y and z axis.