08viewing

l yh l zh x x x l x h x h x l h l 0 0 x h x l x h

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ves no doubt as to t cor can implement . •heWerectness of the resultthis by mapping the view volume A exa canonical us co struction tonthe ctly analogoviewnvolume. can be used to define a 3D windowing transformation, which maps the box [xl , xh ]×[yl , yh ]×[zl , zh ] to the box [xl , xh ]× •y ,This iszjust ]a 3D windowing transformation! [ l yh ] × [ l , zh x −x x l x h −x h x l h l 0 0 x h −x l x h −x l y l y h −y h y l y h −y l 0 0 y h −y l y h −y l . ( 6 .7 ) z l z h −z h z l z h −z l 0 0 z h −z l z h −z l 0 0 0 1 r+ ⇥ It is interesting to note 2hat if we multiply an arbitrlary matrix composed of t 0 0 rl rl scales, shears and rotations with a s2mple translation t+an⌃ation comes second), i (tr b sl ⇧0 0 tb t b⌃ we g e t Morth = ⇧ n 2 ⇤ n+f ⌅ 0 0 n0 f fa a11 a12 a13 a11 a13 xt 1 0 0 xt 12 0 1 0 yt a20 a22 0 a23 0 a21 a22 a23 yt 0 1 1 0 0 1 zt a31 a32 a33 0 = a31 a32 a33 zt . Cornell CS4620 Fall 2013 • Lecture 8 © 2013 Steve Marschner • 15 Camera and modeling matrices • We worked out all the preceding transforms starting from eye coordinates – before we do any of this stuff we need to transform into that space • Transform from world (canonical) to eye space is traditionally called the viewing matrix – it is the canonical-to-frame matrix for the camera frame – that is, Fc–1 • Remember that geometry would originally have been in the object’s local coordinates; transform into world coordinates is called the modeling matrix, Mm • Note many programs combine the two into a modelview matrix and just skip world coordinates Cornell CS4620 Fall 2013 • Lecture 8 © 2013 Steve Marschner • 16 Viewing transformation the camera matrix rewrites all coordinates in eye space Cornell CS4620 Fall 2013 • Lecture 8 © 2013 Steve Marschner • 17 Orthographic transformation chain • Start with coordinates in object’s local coordinates • Transform into world coords (modeling transform, Mm) • Transform into eye coords (camera xf., Mcam = Fc–1) • Orthographic projection, Morth • Viewport transform, Mvp ps = Mvp Morth Mcam Mm po ⇤ ⌅ ⇤ nx xs 2 ⌥ ys ⌥0 ⌥ ⌥ ⇧ zc ⌃ = ⇧ 0 1 0 0 ny 2 0 0 0 0 1 0 nx 1 ⌅ ⇤ 2 rl 2 ny 1 ⌥ ⌥0 2 0 ⌃⇧ 0 1 0 Cornell CS4620 Fall 2013 • Lecture 8 0 2 tb 0 0 0 0 2 nf 0 r +l ⌅ rl t+b tb n+f ⌃ nf 1 uv 00 w 0 ⇤⌅ xo ⇥1 ⌥ yo e Mm ⌥ ⌃ ⇧ zo 1 1 © 2013 Steve Marschner • 18 Perspective projection similar triangles: Cornell CS4620...
View Full Document

This document was uploaded on 03/20/2014.

Ask a homework question - tutors are online