Data.Vec.LinAlg.Transform3D
Description

Some 4x4 transformation matrices, using a right handed coordinate system. These matrices are used by multiplying vectors from the right.

The projection matrices will produce vectors in a left handed coordinate system, i.e. where z goes into the screen.

Synopsis
 translation :: Num a => Vec3 a -> Mat44 a rotationX :: Floating a => a -> Mat44 a rotationY :: Floating a => a -> Mat44 a rotationZ :: Floating a => a -> Mat44 a rotationVec :: Floating a => Vec3 a -> a -> Mat44 a rotationEuler :: Floating a => Vec3 a -> Mat44 a rotationQuat :: Num a => Vec4 a -> Mat44 a rotationLookAt :: Floating a => Vec3 a -> Vec3 a -> Vec3 a -> Mat44 a scaling :: Num a => Vec3 a -> Mat44 a perspective :: Floating a => a -> a -> a -> a -> Mat44 a orthogonal :: Fractional a => a -> a -> Vec2 a -> Mat44 a
Documentation
 translation :: Num a => Vec3 a -> Mat44 a Source
A 4x4 translation matrix
 rotationX Source
 :: Floating a => a The angle in radians -> Mat44 a A 4x4 rotation matrix for a rotation around the X axis
 rotationY Source
 :: Floating a => a The angle in radians -> Mat44 a A 4x4 rotation matrix for a rotation around the Y axis
 rotationZ Source
 :: Floating a => a The angle in radians -> Mat44 a A 4x4 rotation matrix for a rotation around the Z axis
 rotationVec Source
 :: Floating a => Vec3 a The normalized vector around which the rotation goes -> a The angle in radians -> Mat44 a A 4x4 rotation matrix for a rotation around an arbitrary normalized vector
 rotationEuler :: Floating a => Vec3 a -> Mat44 a Source
A 4x4 rotation matrix from the euler angles yaw pitch and roll. Could be useful in e.g. first person shooter games,
 rotationQuat Source
 :: Num a => Vec4 a The quaternion with the real part (w) last -> Mat44 a A 4x4 rotation matrix from a normalized quaternion. Useful for most free flying rotations, such as airplanes.
 rotationLookAt Source
 :: Floating a => Vec3 a The up direction, not necessary unit length or perpendicular to the view vector -> Vec3 a The viewers position -> Vec3 a The point to look at -> Mat44 a A 4x4 rotation matrix for turning toward a point. Useful for targeting a camera to a specific point.
 scaling :: Num a => Vec3 a -> Mat44 a Source
A 4x4 scaling matrix
 perspective Source
 :: Floating a => a Near plane clipping distance (always positive) -> a Far plane clipping distance (always positive) -> a Field of view of the y axis, in radians -> a Aspect ratio, i.e. screen's width/height -> Mat44 a A perspective projection matrix for a right handed coordinate system looking down negative z. This will project far plane to z = +1 and near plane to z = -1, i.e. into a left handed system.
 orthogonal Source
 :: Fractional a => a Near plane clipping distance -> a Far plane clipping distance -> Vec2 a The size of the view (center aligned around origo) -> Mat44 a An orthogonal projection matrix for a right handed coordinate system looking down negative z. This will project far plane to z = +1 and near plane to z = -1, i.e. into a left handed system.