linear-1.16.4: Linear Algebra

Copyright(C) 2014 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell98

Linear.Projection

Description

Common projection matrices: e.g. perspective/orthographic transformation matrices.

Analytically derived inverses are also supplied, because they can be much more accurate in practice than computing them through general purpose means

Synopsis

Documentation

lookAt Source

Arguments

:: (Epsilon a, Floating a) 
=> V3 a

Eye

-> V3 a

Center

-> V3 a

Up

-> M44 a 

Build a look at view matrix

perspective Source

Arguments

:: Floating a 
=> a

FOV (y direction, in radians)

-> a

Aspect ratio

-> a

Near plane

-> a

Far plane

-> M44 a 

Build a matrix for a symmetric perspective-view frustum

inversePerspective Source

Arguments

:: Floating a 
=> a

FOV (y direction, in radians)

-> a

Aspect ratio

-> a

Near plane

-> a

Far plane

-> M44 a 

Build an inverse perspective matrix

infinitePerspective Source

Arguments

:: Floating a 
=> a

FOV (y direction, in radians)

-> a

Aspect Ratio

-> a

Near plane

-> M44 a 

Build a matrix for a symmetric perspective-view frustum with a far plane at infinite

inverseInfinitePerspective Source

Arguments

:: Floating a 
=> a

FOV (y direction, in radians)

-> a

Aspect Ratio

-> a

Near plane

-> M44 a 

frustum Source

Arguments

:: Floating a 
=> a

Left

-> a

Right

-> a

Bottom

-> a

Top

-> a

Near

-> a

Far

-> M44 a 

Build a perspective matrix per the classic glFrustum arguments.

inverseFrustum Source

Arguments

:: Floating a 
=> a

Left

-> a

Right

-> a

Bottom

-> a

Top

-> a

Near

-> a

Far

-> M44 a 

ortho Source

Arguments

:: Fractional a 
=> a

Left

-> a

Right

-> a

Bottom

-> a

Top

-> a

Near

-> a

Far

-> M44 a 

Build an orthographic perspective matrix from 6 clipping planes

inverseOrtho Source

Arguments

:: Fractional a 
=> a

Left

-> a

Right

-> a

Bottom

-> a

Top

-> a

Near

-> a

Far

-> M44 a 

Build an inverse orthographic perspective matrix from 6 clipping planes