5 1 cornell cs4620 fall 2013 lecture 8 5 5 nx 5 2013

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: d coordinates in pixel units, though • Exactly the opposite of mapping (i,j) to (u,v) in ray generation 1 –1 –1 ny – .5 1 Cornell CS4620 Fall 2013 • Lecture 8 –.5 –.5 nx – .5 © 2013 Steve Marschner • 9 ransform matrix that takes points in the rectangle [xl , xh ] × [yl , yh ] to the 1 th tangle [xl , xh ] × [yl , yh ]. This can be accomplished wi36a single scale and nslate in sequence. However, it is more intuitive to create the transform from a uence of three operations (Figure 6.16): Windowing transformsring that the right-hand matrix6.isTrapspfolrim 1Remembe 36 an e 1. Move the point (xl , yl ) to the origin. x −x y axis-alignedxl yh xh − h l m mb w ,h 2. Scale the rectangle to be the same size as the target Rewiendloring tharanslahe hand,mat)ixsc apelied first, we can wr r ectan g e . = t t the rig tt- (xl yl r is l p 3. • This transformation is worth generalizing: take one xh − xl yh − yl , Move threctanglent (xl ,box to anotherwindow = translate (xl , yl ) scale e origin to poi or yl ). transla xh − xl yh − yl – a useful, if mundane, piece of a transformation chain x h −x l 1 x xlx xh −xl 0 0− 10 1 xl 0 0 − 0 xy x h −y l y (xh, yh) 1 =1 0 yh yl = 0 0 yl 0l y −y 0 0 −1 y −y 0 00 0 00 1 0 1 (xl, yl) 0 00 1 h l h l h l h l (xh – xl, yh – yl) x h −x l 0 xh −xlxh −xl y = 0 xh −h −yl xl y h −y l =0 0 0 0 x l x h −x h x l x h −x l x l x h −x h x l y l y h −y h y l . x h −x l y h −y l 0 yh −1 l y y h −y l 0 y l y h −y h y l y h −y l 1 0 −xl 0 −yl 1 1 . It is pe(x′hap′h)not surprising to some readers that the resulting matr rh , y s (x′ – x′ , y′ – y′ ) h lh l it does, but the constructive process with the three matrices leaves the correctness of the result. It iAnpeerhtapannlot ousrcorissrucgion canme reeddterdethatath s xac ly s a og su p n tin t to so be us a o s fine 3 (x′ , y′ ) ll tit nsoem,abon, thech onps rhectove l , roce[ss, wi]th[zlhzhthrthe ra d fors...
View Full Document

Ask a homework question - tutors are online