gelatin-0.1.0.1: A graphics description language.

Safe HaskellNone
LanguageHaskell2010

Gelatin.Core.Transform

Description

Limited spatial transformations in 2 and 3 dimensions.

Synopsis

Documentation

data Affine a r Source #

Constructors

Translate a 
Scale a 
Rotate r 

Instances

(Eq r, Eq a) => Eq (Affine a r) Source # 

Methods

(==) :: Affine a r -> Affine a r -> Bool #

(/=) :: Affine a r -> Affine a r -> Bool #

(Show r, Show a) => Show (Affine a r) Source # 

Methods

showsPrec :: Int -> Affine a r -> ShowS #

show :: Affine a r -> String #

showList :: [Affine a r] -> ShowS #

type Affine2 a = Affine (V2 a) a Source #

type Affine3 a = Affine (V3 a) (a, V3 a) Source #

promoteV2 :: Num a => V2 a -> V3 a Source #

Promotes a point in R2 to a point in R3 by setting the z coord to '0'.

demoteV3 :: V3 a -> V2 a Source #

Demotes a point in R3 to a point in R2 by discarding the z coord.

promoteAffine2 :: Num a => Affine2 a -> Affine3 a Source #

Promotes an affine transformation in R2 to one in R3 by using promoteV2 in case of translation or scaling, and promotes rotation as a rotation about the z axis.

transformV2 :: Num a => M44 a -> V2 a -> V2 a Source #

transformV3 :: RealFloat a => M44 a -> V3 a -> V3 a Source #

v3ToM41 :: Num a => V3 a -> V4 (V1 a) Source #

m41ToV3 :: V4 (V1 a) -> V3 a Source #

rotateAbout :: (Num a, Epsilon a, Floating a) => V3 a -> a -> V3 a -> V3 a Source #

mat4Translate :: Num a => V3 a -> M44 a Source #

mat4Rotate :: (Num a, Epsilon a, Floating a) => a -> V3 a -> M44 a Source #

mat4Scale :: Num a => V3 a -> M44 a Source #