hgeometry-0.12.0.2: Geometric Algorithms, Data structures, and Data types.
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Graphics.Camera

Description

 
Synopsis

Documentation

data Camera r Source #

A basic camera data type. The fields stored are:

  • the camera position,
  • the raw camera normal, i.e. a unit vector into the center of the screen,
  • the raw view up vector indicating which side points "upwards" in the scene,
  • the viewplane depth (i.e. the distance from the camera position to the plane on which we project),
  • the near distance (everything closer than this is clipped),
  • the far distance (everything further away than this is clipped), and
  • the screen dimensions.

Constructors

Camera !(Point 3 r) !(Vector 3 r) !(Vector 3 r) !r !r !r !(Vector 2 r) 

Instances

Instances details
Eq r => Eq (Camera r) Source # 
Instance details

Defined in Graphics.Camera

Methods

(==) :: Camera r -> Camera r -> Bool #

(/=) :: Camera r -> Camera r -> Bool #

Ord r => Ord (Camera r) Source # 
Instance details

Defined in Graphics.Camera

Methods

compare :: Camera r -> Camera r -> Ordering #

(<) :: Camera r -> Camera r -> Bool #

(<=) :: Camera r -> Camera r -> Bool #

(>) :: Camera r -> Camera r -> Bool #

(>=) :: Camera r -> Camera r -> Bool #

max :: Camera r -> Camera r -> Camera r #

min :: Camera r -> Camera r -> Camera r #

Show r => Show (Camera r) Source # 
Instance details

Defined in Graphics.Camera

Methods

showsPrec :: Int -> Camera r -> ShowS #

show :: Camera r -> String #

showList :: [Camera r] -> ShowS #

cameraPosition :: Lens' (Camera r) (Point 3 r) Source #

Camera position.

rawCameraNormal :: Lens' (Camera r) (Vector 3 r) Source #

Raw camera normal, i.e. a unit vector into the center of the screen.

rawViewUp :: Lens' (Camera r) (Vector 3 r) Source #

Raw view up vector indicating which side points "upwards" in the scene.

viewPlaneDepth :: Lens' (Camera r) r Source #

Viewplane depth (i.e. the distance from the camera position to the plane on which we project).

nearDist :: Lens' (Camera r) r Source #

Near distance (everything closer than this is clipped).

farDist :: Lens' (Camera r) r Source #

Far distance (everything further away than this is clipped).

screenDimensions :: Lens' (Camera r) (Vector 2 r) Source #

Screen dimensions.

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.