diagrams-lib-1.4.6.2: Embedded domain-specific language for declarative graphics

Copyright | (c) 2013 diagrams-lib team (see LICENSE)
License | BSD-style (see LICENSE)
Maintainer | diagrams-discuss@googlegroups.com
Safe Haskell | Safe-Inferred
Language | Haskell2010

Diagrams.ThreeD.Camera

Description

Types to specify viewpoint for 3D rendering.

Synopsis

- data Camera l n
- data PerspectiveLens n = PerspectiveLens {
  - _horizontalFieldOfView :: Angle n
  - _verticalFieldOfView :: Angle n
  }
- data OrthoLens n = OrthoLens {
  - _orthoWidth :: n
  - _orthoHeight :: n
  }
- horizontalFieldOfView :: forall n. Lens' (PerspectiveLens n) (Angle n)
- verticalFieldOfView :: forall n. Lens' (PerspectiveLens n) (Angle n)
- orthoWidth :: forall n. Lens' (OrthoLens n) n
- orthoHeight :: forall n. Lens' (OrthoLens n) n
- camLoc :: Camera l n -> Point V3 n
- camForward :: Camera l n -> Direction V3 n
- camUp :: Camera l n -> Direction V3 n
- camRight :: Fractional n => Camera l n -> Direction V3 n
- camLens :: Camera l n -> l n
- facing_ZCamera :: (Floating n, Ord n, Typeable n, CameraLens l, Renderable (Camera l n) b) => l n -> QDiagram b V3 n Any
- mm50Camera :: (Typeable n, Floating n, Ord n, Renderable (Camera PerspectiveLens n) b) => QDiagram b V3 n Any
- mm50 :: Floating n => PerspectiveLens n
- mm50Wide :: Floating n => PerspectiveLens n
- mm50Narrow :: Floating n => PerspectiveLens n
- aspect :: (CameraLens l, Floating n) => l n -> n
- camAspect :: (Floating n, CameraLens l) => Camera l n -> n

# Documentation

data Camera l n Source #

#### Instances

Instances details

Num n => Transformable (Camera l n) Source # |
Instance details Defined in Diagrams.ThreeD.Camera Methods transform :: Transformation (V (Camera l n)) (N (Camera l n)) -> Camera l n -> Camera l n Source #
Num n => Renderable (Camera l n) NullBackend Source # |
Instance details Defined in Diagrams.ThreeD.Camera Methods render :: NullBackend -> Camera l n -> Render NullBackend (V (Camera l n)) (N (Camera l n)) Source #
type N (Camera l n) Source # |
Instance details Defined in Diagrams.ThreeD.Camera type N (Camera l n) = n
type V (Camera l n) Source # |
Instance details Defined in Diagrams.ThreeD.Camera type V (Camera l n) = V3

data PerspectiveLens n Source #

A perspective projection

Constructors

PerspectiveLens |

Fields

- _horizontalFieldOfView :: Angle n

  Horizontal field of view.

- _verticalFieldOfView :: Angle n

  Vertical field of view.

#### Instances

Instances details

type N (PerspectiveLens n) Source # |
Instance details Defined in Diagrams.ThreeD.Camera type N (PerspectiveLens n) = n
type V (PerspectiveLens n) Source # |
Instance details Defined in Diagrams.ThreeD.Camera type V (PerspectiveLens n) = V3

data OrthoLens n Source #

An orthographic projection

Constructors

OrthoLens |

Fields

- _orthoWidth :: n

  Width

- _orthoHeight :: n

  Height

#### Instances

Instances details

type N (OrthoLens n) Source # |
Instance details Defined in Diagrams.ThreeD.Camera type N (OrthoLens n) = n
type V (OrthoLens n) Source # |
Instance details Defined in Diagrams.ThreeD.Camera type V (OrthoLens n) = V3

horizontalFieldOfView :: forall n. Lens' (PerspectiveLens n) (Angle n) Source #

verticalFieldOfView :: forall n. Lens' (PerspectiveLens n) (Angle n) Source #

orthoWidth :: forall n. Lens' (OrthoLens n) n Source #

orthoHeight :: forall n. Lens' (OrthoLens n) n Source #

camLoc :: Camera l n -> Point V3 n Source #

camForward :: Camera l n -> Direction V3 n Source #

camUp :: Camera l n -> Direction V3 n Source #

camRight :: Fractional n => Camera l n -> Direction V3 n Source #

camLens :: Camera l n -> l n Source #

facing_ZCamera :: (Floating n, Ord n, Typeable n, CameraLens l, Renderable (Camera l n) b) => l n -> QDiagram b V3 n Any Source #

'facing_ZCamera l' is a camera at the origin facing along the negative Z axis, with its up-axis coincident with the positive Y axis, with the projection defined by l.

mm50Camera :: (Typeable n, Floating n, Ord n, Renderable (Camera PerspectiveLens n) b) => QDiagram b V3 n Any Source #

A camera at the origin facing along the negative Z axis, with its up-axis coincident with the positive Y axis. The field of view is chosen to match a 50mm camera on 35mm film. Note that Cameras take up no space in the Diagram.

mm50 :: Floating n => PerspectiveLens n Source #

mm50 has the field of view of a 50mm lens on standard 35mm film, hence an aspect ratio of 3:2.

mm50Wide :: Floating n => PerspectiveLens n Source #

mm50blWide has the same vertical field of view as mm50, but an aspect ratio of 1.6, suitable for wide screen computer monitors.

mm50Narrow :: Floating n => PerspectiveLens n Source #

mm50Narrow has the same vertical field of view as mm50, but an aspect ratio of 4:3, for VGA and similar computer resolutions.

aspect :: (CameraLens l, Floating n) => l n -> n Source #

The natural aspect ratio of the projection.

camAspect :: (Floating n, CameraLens l) => Camera l n -> n Source #