Copyright | (c) 2015 Brian W Bush |
---|---|
License | MIT |
Maintainer | Brian W Bush <consult@brianwbush.info> |
Stability | Stable |
Portability | Portable |
Safe Haskell | None |
Language | Haskell2010 |
Functions for managing perspectives and frusta.
- data ViewerParameters a = ViewerParameters {
- screen :: Screen a
- nearPlane :: a
- farPlane :: a
- eyePosition :: Vertex3 a
- eyeSeparation :: Vector3 a
- eyeUpward :: Vector3 a
- sceneCenter :: Vertex3 a
- sceneScale :: Vector3 a
- viewerGeometry :: (Fractional a, Storable a) => a -> a -> a -> ViewerParameters a
- displayAspectRatio :: (AdditiveGroup a, RealFloat a, Storable a) => ViewerParameters a -> a
- displayThrowRatio :: (AdditiveGroup a, RealFloat a, Storable a) => ViewerParameters a -> a
- fieldOfView :: (AdditiveGroup a, RealFloat a, Storable a) => ViewerParameters a -> a
- phoneViewer :: (Fractional a, Storable a) => ViewerParameters a
- laptopViewer :: (Fractional a, Storable a) => ViewerParameters a
- desktopViewer :: (Fractional a, Storable a) => ViewerParameters a
- projectorViewer :: (Fractional a, Storable a) => ViewerParameters a
- glassesViewer :: (Fractional a, Storable a) => ViewerParameters a
- reshape :: (AdditiveGroup a, MatrixComponent a, RealFloat a, Storable a) => ViewerParameters a -> ReshapeCallback
- loadViewer :: (AdditiveGroup a, MatrixComponent a, RealFloat a, Storable a) => Bool -> ViewerParameters a -> DlpEye -> IO ()
- dlpViewerDisplay :: (AdditiveGroup a, MatrixComponent a, RealFloat a, Storable a) => Bool -> DlpEncoding -> ViewerParameters a -> DisplayCallback -> DlpDisplay
- dlpViewerDisplay' :: (AdditiveGroup a, MatrixComponent a, RealFloat a, Storable a) => Bool -> DlpEncoding -> IORef (ViewerParameters a) -> DisplayCallback -> DlpDisplay
Viewer Geometry
data ViewerParameters a Source
Paramaters specifying a viewer, including the frustum of the view.
ViewerParameters | |
|
Functor ViewerParameters Source | |
Eq a => Eq (ViewerParameters a) Source | |
Data a => Data (ViewerParameters a) Source | |
Read a => Read (ViewerParameters a) Source | |
Show a => Show (ViewerParameters a) Source | |
Generic (ViewerParameters a) Source | |
(Generic a, FromJSON a) => FromJSON (ViewerParameters a) Source | |
(Generic a, Binary a) => Binary (ViewerParameters a) Source | |
(Fractional a, Storable a) => Default (ViewerParameters a) Source | |
type Rep (ViewerParameters a) Source |
:: (Fractional a, Storable a) | |
=> a | The aspect ratio (width over height) of the screen or display. |
-> a | The throw ratio (distance over width) of the screen or display. |
-> a | The distance from the eyes to the screen or display, in inches. |
-> ViewerParameters a | The corresponding viewer parameters. |
Construct viewer geometry from physical geometry.
:: (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.
:: (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.
:: (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.
glassesViewer :: (Fractional a, Storable a) => ViewerParameters a Source
Viewer parameters for typical VR glasses.
Callbacks and Rendering
:: (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.
:: (AdditiveGroup a, MatrixComponent a, RealFloat a, Storable a) | |
=> Bool | Whether to use an on-axis projection. |
-> 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.
:: (AdditiveGroup a, MatrixComponent a, RealFloat a, Storable a) | |
=> Bool | Whether to use on-axis projection. |
-> 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.
:: (AdditiveGroup a, MatrixComponent a, RealFloat a, Storable a) | |
=> Bool | Whether to use on-axis projection. |
-> DlpEncoding | The DLP encoding. |
-> IORef (ViewerParameters a) | A reference to 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.