handa-opengl-0.1.11.2: Utility functions for OpenGL and GLUT

Copyright(c) 2015 Brian W Bush
LicenseMIT
MaintainerBrian W Bush <consult@brianwbush.info>
StabilityStable
PortabilityPortable
Safe HaskellNone
LanguageHaskell2010

Graphics.Rendering.Handa.Viewer

Contents

Description

Functions for managing perspectives and frusta.

Synopsis

Viewer Geometry

data ViewerParameters a Source

Paramaters specifying a viewer, including the frustum of the view.

Constructors

ViewerParameters 

Fields

screen :: Screen a

The screen location.

nearPlane :: a

The distance to the near plane of the frustum.

farPlane :: a

The distance to the far plane of the frustum.

eyePosition :: Vertex3 a

The position of the eyes.

eyeSeparation :: Vector3 a

The separation between the eyes.

eyeUpward :: Vector3 a

The upward direction.

sceneCenter :: Vertex3 a

The center of the scene.

sceneScale :: Vector3 a

The factor by which to scale the scene.

viewerGeometry Source

Arguments

:: (Fractional a, Storable a) 
=> a

The width of the screen or display.

-> a

The height of the screen or display.

-> a

The distance from the eyes to the screen or display.

-> ViewerParameters a

The corresponding viewer parameters.

Construct viewer geometry from physical geometry.

displayAspectRatio Source

Arguments

:: (AdditiveGroup a, RealFloat a, Storable a) 
=> ViewerParameters a

The viewer parameters.

-> a

The aspect ratio, namely the screen width divided by its height.

The aspect ratio of the viewer.

displayThrowRatio Source

Arguments

:: (AdditiveGroup a, RealFloat a, Storable a) 
=> ViewerParameters a

The viewer parameters.

-> a

The throw ratio, namely the distance to the screen divided by its height.

The throw ratio of the viewer.

fieldOfView Source

Arguments

:: (AdditiveGroup a, RealFloat a, Storable a) 
=> ViewerParameters a

The viewer parameters

-> a

The field of view, in degrees.

Compute the field of view for viewer parameters.

Typical Devices

phoneViewer :: (Fractional a, Storable a) => ViewerParameters a Source

Viewer parameters for a typical smartphone screen.

laptopViewer :: (Fractional a, Storable a) => ViewerParameters a Source

Viewer parameters for a typical laptop screen.

desktopViewer :: (Fractional a, Storable a) => ViewerParameters a Source

Viewer parameters for a typical desktop monitor.

projectorViewer :: (Fractional a, Storable a) => ViewerParameters a Source

Viewer parameters for a typical projector.

Callbacks and Rendering

reshape Source

Arguments

:: (AdditiveGroup a, MatrixComponent a, RealFloat a, Storable a) 
=> ViewerParameters a

The viewer parameters.

-> ReshapeCallback

The reshape callback.

Construct a reshape callback from viewer parameters. This simply sets the frustum based on the viewer parameters and the size of the viewport.

loadViewer Source

Arguments

:: (RealFloat a, Storable a) 
=> ViewerParameters a

The viewer parameters.

-> DlpEye

The eye from which to view.

-> IO ()

An action for looking at the scene using the specified eye and viewer parameters.

Create an action look at the scene according to the viewer parameters.

dlpViewerDisplay Source

Arguments

:: (RealFloat a, Storable a) 
=> DlpEncoding

The DLP encoding.

-> ViewerParameters a

The viewer parameters.

-> DisplayCallback

The display callback.

-> DlpDisplay

The DLP display data for using the specified encoding, viewer parameters, and display callback.

Construct a DLP display from a display callback.