-- | model matrix from camera
cameraModelMat4 :: Camera -> Mat4
cameraModelMat4 camera =
    let
        -- TurnB:
        turnB = turnInverse $ cameraTurnB camera
        turnB' = turnInverse $ cameraTurnBIdeal camera
        matTurnB = mat4SmoothTurn turnB turnB' $ cameraTurnBAlpha camera

        -- TurnA:
        turnA = turnInverse $ cameraTurnA camera
        turnA' = turnInverse $ cameraTurnAIdeal camera
        matTurnA = mat4SmoothTurn turnA turnA' $ cameraTurnAAlpha camera

        -- translate:
        node = cameraNode camera
        node' = cameraNodeIdeal camera
        Vec4 x y z w = smoothNode node node' $ cameraNodeAlpha camera
        matTranslate = mat4TranslationAnti x y z w 

    in  matTurnB `mappend` matTurnA `mappend` matTranslate
cameraModelMat4 :: Camera -> Mat4
cameraModelMat4 camera =
    let
        -- TurnB:
        turnB = turnInverse $ cameraTurnB camera
        turnB' = turnInverse $ cameraTurnBIdeal camera
        matTurnB = mat4SmoothTurn turnB turnB' $ cameraTurnBAlpha camera

        -- TurnA:
        turnA = turnInverse $ cameraTurnA camera
        turnA' = turnInverse $ cameraTurnAIdeal camera
        matTurnA = mat4SmoothTurn turnA turnA' $ cameraTurnAAlpha camera

        -- translate:
        node = cameraNode camera
        node' = cameraNodeIdeal camera
        Vec4 x y z w = smoothNode node node' $ cameraNodeAlpha camera
        matTranslate = mat4TranslationAnti x y z w 

    in  matTurnB `mappend` matTurnA `mappend` matTranslate
cameraModelMat4 camera =
    let
        -- TurnB:
        turnB = turnInverse $ cameraTurnB camera
        turnB' = turnInverse $ cameraTurnBIdeal camera
        matTurnB = mat4SmoothTurn turnB turnB' $ cameraTurnBAlpha camera

        -- TurnA:
        turnA = turnInverse $ cameraTurnA camera
        turnA' = turnInverse $ cameraTurnAIdeal camera
        matTurnA = mat4SmoothTurn turnA turnA' $ cameraTurnAAlpha camera

        -- translate:
        node = cameraNode camera
        node' = cameraNodeIdeal camera
        Vec4 x y z w = smoothNode node node' $ cameraNodeAlpha camera
        matTranslate = mat4TranslationAnti x y z w 

    in  matTurnB `mappend` matTurnA `mappend` matTranslate