--------------------------------------------------------------------------------
--  

-- how to typically output to Screen:
-- 
-- 0. setup screen:                                             done by Scene
-- 1. define projection matrix (a view property of GL camera):  sceneProj2D/sceneProj3D
-- 2. define modelview matrix (GL camera placement):            cameraViewMat4/cameraModelMat4 
-- 3. set shaders using these matrices, and draw


--------------------------------------------------------------------------------
--  


-- | view matrix from Camera
cameraViewMat4 :: Camera -> Mat4
cameraViewMat4 camera = 
    let View a b c = cameraView camera
        View a' b' c' = cameraViewIdeal camera
        
        a'' = smooth a a' $ cameraViewAAlpha camera
        b'' = smooth b b' $ cameraViewBAlpha camera
        c'' = smooth c c' $ cameraViewCAlpha camera
    in  mat4ViewABC (tau * 0.25 + a'') b'' c''
cameraViewMat4 :: Camera -> Mat4
cameraViewMat4 camera = 
    let View a b c = cameraView camera
        View a' b' c' = cameraViewIdeal camera
        
        a'' = smooth a a' $ cameraViewAAlpha camera
        b'' = smooth b b' $ cameraViewBAlpha camera
        c'' = smooth c c' $ cameraViewCAlpha camera
    in  mat4ViewABC (tau * 0.25 + a'') b'' c''
cameraViewMat4 camera = 
    let View a b c = cameraView camera
        View a' b' c' = cameraViewIdeal camera
        
        a'' = smooth a a' $ cameraViewAAlpha camera
        b'' = smooth b b' $ cameraViewBAlpha camera
        c'' = smooth c c' $ cameraViewCAlpha camera
    in  mat4ViewABC (tau * 0.25 + a'') b'' c''