MAP. Vectors and Transforms. Reading instructions Quick Repetition of Vector Algebra. In 3D Graphics. Repetition of the Rendering Pipeline

Size: px
Start display at page:

Download "MAP. Vectors and Transforms. Reading instructions Quick Repetition of Vector Algebra. In 3D Graphics. Repetition of the Rendering Pipeline"

Transcription

1 79 MAP Skämtbil om matte å KTHanimationskurs Vectors an Transforms In 3D Grahics Reetition of the Renering Pieline Geometr er verte: Lighting (colors) Screen sace ositions Reetition of the Renering Pieline light Geometr blue re green light Geometr blue re green Rasterier Rasterier: Rasteriation Tetures Interolate colors HARDWARE Alication Geometr Rasterier HARDWARE Alication Geometr Rasterier 3 Verte shaer rogram Piel shaer rogram Disla Ulf Assarsson 7 4 Verte shaer rogram Piel shaer rogram Disla Ulf Assarsson 7 Reaing instructions VERY IMPORTANT READ HOME PAGE in connection to each lecture COURSE HOME PAGE is locate here (an nowhere else): htt:// Quick Reetition of Vector Algebra COURSE HOME PAGE

2 79 Wh transforms? We want to be able to animate objects an the camera Translations Rotations Shears An more We want to be able to use rojection transforms Tomas AkenineMőller How imlement transforms? Matrices! Can ou reall o everthing with a matri? Not everthing, but a lot! We use 33 an 44 matrices m M m m m m m m m m Tomas AkenineMőller Moving an object Demo Ul f Assarsson 7 Transformation Pieline v e r t e object ee cli normalie evice Moelview Matri Moelview Moelview Projection Matri Projection Persective Division Viewort Transform other calculations here material color shae moel (flat) olgon renering moe olgon culling cliing winow OenGL Geometr stage Mainl Ulf Assarsson on GPU 7 Moel to Worl Matri The OenGL Pieline Moel sace Wor sace camera Worl to View Matri MoelViewMt = Moel to View Matri View sace Tomas AkenineMőller From htt://eltronslair.com/glie.html Tomas AkenineMőller

3 79 How o I use transforms racticall? Sa ou have a circle with origin at (,,) an with raius unit circle gltranslatef(8,,); RenerCircle(); gltranslatef(3,,); glscalef(,,); RenerCircle(); Cont from revious slie A simle D eamle A circle in moel sace gltranslatef(3,,); glscalef(,,); gltranslatef(8,,); Tomas AkenineMőller Tomas AkenineMőller Rotation (D) Consier rotation about the origin b q egrees raius stas the same, angle increases b q ' = r cos (f + q) ' = r sin (f + q) '? '? = r cos f = r sin f?? Answer: = cos q sin q = sin q + cos q Derivation of rotation matri in D re n e if i (, ) re n ( n, n ) i r(cos f + i sinf) [rotation is mult b e ] T T n R? e i if r[(cos + i sin )(cosf + i sinf)] r(cos cosf sin sinf) + n ir(cos sin f + sin cosf) ( r cosf, r sinf) ( r(cos cosf sin sinf), r(cos sinf + sin cosf)) T T Tomas AkenineMőller Derivation D rotation, cont n n (, ) n ( n, n ) r(cos sin f + sin cosf)) n R T T ( r cosf, r sin f) cos sin sin cos R ( r(cos cosf sin sin f), what is R? T T Tomas AkenineMőller Rotations in 3D Same as in D for Zrotations, but with a 33 matri cos sin cos sin R ( ) R ( ) sin cos sin cos For X For Y R ( ) cos sin sin cos cos sin R ( ) sin cos Tomas AkenineMőller 3

4 79 Translations must be simle? Translation Rotation?????? + t R n??? Rotation is matri mult, translation is a Woul be nice if we coul onl use matri multilications Turn to homogeneous coorinates A a new comonent to each vector Tomas AkenineMőller Homogeneous notation A oint: Translation becomes: t + t t + t t + t T( t) A vector (irection): Translation of vector: T Also allows for rojections (later) ) T ) T Tomas AkenineMőller Rotations in 44 form Just a a row at the bottom, an a column at the right: R cos sin sin cos ( ) Similarl for X an Y et( R )= (for 33 matrices) Trace( R )=+cos(alha) (for an ais,33) Tomas AkenineMőller M Change of Frames M moeltoworl : a o a a a b b b c c c moeltoworl o o o worl sace E.g.: worl = M mw moel = M mw (,5,) T = 5 b (+ o) c (,5,) b moel sace More basic transforms Scaling Normal transforms Not so normal Shear Rigibo: rotation then translation X TR Concatenation of matrices Not commutative, i.e., RT TR In X TR, the rotation is one first Inverses an rotation about arbitrar ais: Rigi bo: X = X T Tomas AkenineMőller Cannot use same matri to transform normals Use: N M ) T instea of M M works for rotations an translations, though Tomas AkenineMőller 4

5 79 The Euler Transform Assume the view looks own the negative ais, with u in the irection, to the right E( h,, r) R ( r) R ( ) R ( h) h=hea =itch r=roll Gimbal lock can occur looses one egree of freeom Eamle: h=,=/, then the rotation is the Quaternions qˆ ( q, q ) ( q, q, q, q ) iq + jq + kq + qw Etension of imaginar numbers Avois gimbal lock that the Euler coul rouce Focus on unit quaternions: n(ˆ) q q + q + q + qw A unit quaternion is: qˆ (sinfu q,cos f) where u same as oing a revious rot aroun Tomas AkenineMőller ais Tomas AkenineMőller v w w q Unit quaternions are erfect for rotations! Comact (4 comonents) Can show that qq ˆ ˆ ˆ reresents a rotation of f raians aroun uq of qˆ (sin u,cos f) f q Projections Orthogonal (arallel) an Persective That is: a unit quaternion reresent a rotation as a rotation ais an an angle OenGL: glrotatef(u,u,u,angle); Interolation from one quaternion to another is much simler, an gives otimal results Tomas AkenineMőller Tomas AkenineMőller Orthogonal rojection Simle, just ski one coorinate Sa, we re looking along the ais Then ro, an rener M ortho M ortho image lane Orthogonal rojection Not invertible! (eterminant is ero) For Zbuffering It is not sufficient to roject to a lane Rather, we nee to roject to a bo near far Unit cube: [,,] to [,,] Tomas AkenineMőller ee Unit cube is also use for ersective roj. Simlifies cliing Tomas AkenineMőller 5

6 79 6 Tomas AkenineMőller Orthogonal rojection The unitcube rojection is invertible Simle to erive Just a translation an scale left right bottom to near far Tomas AkenineMőller What about those homogenenous coorinates? ) T w w= for vectors, an w= for oints What if w is not or? Solution is to ivie all comonents b w ) T w w w / / / Gives a oint again! Can be use for rojections, as we will see Tomas AkenineMőller Persective rojection q q q For : > / P Tomas AkenineMőller Persective rojection The arrow is the homogeniation rocess / P? P / P / / / / / / q q q Tomas AkenineMőller Persective rojection Again, the eterminant is (not invertible) To make the rest of the ieline the same as for orhogonal rojection: roject into unitcube Not much ifferent from P Do not collase coor to a lane Tomas AkenineMőller Unerstaning the rojection matri Scaling Skew Kee info / c s b s a s P c s b s a s / ) / ( ' ) / ( ' ) / ( 3 c b a q

7 79 Persective rojection matrices See Från Värl till Skärm secion 4 for more etails. BREAK... Quick Reetition of Vector Algebra Length of vector: Normaliing a vector: ˆ Normal: ) ) n v v v v (usual normalie as well) + + ) + + ) Tomas AkenineMőller Cross Prouct: Perenicular vector Area va vb sin α: sin v v va vb Dot rouct: cos v v a a b b Ra/Plane Intersections Ra: r(t)=o+t Plane: n + = ; =n Set =r(t): n (o+t) = n o+t(n ) = t = ( n o) / (n ) Put ifferentl: Line/Line intersection in D r (s) = o +s r (t) = o +t r (s) = r (t) () o +s = o +t () noting that =, [=(a,b) =(b,a)] ( o o ) s n ( o ) s = (o o ) ( ) a t n ( ) = (o o ) ( o o) t Note: for t to be the true istance, ( ) must be of unit length. Ulf Assarsson 6 Ulf Assarsson 6 Line/Line intersection in 3D r (s) = o +s r (t) = o +t r (s) = r (t) () o +s = o +t () noting that = s = (o o ) t = (o o ) s ( ) ( ) = ((o o ) ) ( ) t ( ) ( ) = ((o o ) ) ( ) et( o o,, ) ( ) = means arallel lines et( o o,, ) s t ( ) ( ) Ulf Assarsson 6 s, t correson to closest oints Area an Perimeter For olgon,... n Perimeter = omkrets = sum of length of each ege in D an 3D: O n i A Area in D: n i+ i i n i i i+ i ) + i+ i ) + i+ i ) i+ i+ i v v We can unerstan the formula from using Greens theorem: integrating over borer to get area Choose arbitrar oint to integrate from, e.g. Origin (,,) Works for nonconve olgons as well A triangle v v ) Ulf Assarsson 6 7

8 79 Volume in 3D The same trick for comuting area in D can be use to easil comute the volume in 3D for triangulate objects Again, choose arbitrar ointofintegration, e.g. Origin (,,) With resect to ointofintegration For all backfacing triangles, a volume For all frontfacing triangles, subtract volume Works for nonconve olgons as well V tetrahero n V object 3! a 3! n i a 3! bc) et( a, b, c) bc) where a = origin b = origin c = 3 origin The sign of the eterminant will automaticall hanle ositive an negative contribution Ulf Assarsson 6 Scan Conversion of Line Segments Start with line segment in winow coorinates with integer values for enoints Assume imlementation has a write_iel function k = k + m DDA Algorithm Digital Differential Analer DDA was a mechanical evice for numerical solution of ifferential equations Line =k+ m satisfies ifferential equation / = k = / = / Along scan line = =; For(=; <=,i++) { write_iel(, roun(), line_color) +=k; } Problem DDA = for each lot iel at closest Problems for stee lines Using Smmetr Use for k For k >, swa role of an For each, lot closest The roblem with DDA is that it uses floats which was slow in the ol as Bresenhams algorithm onl uses integers 8

9 79 Bresenham s line rawing algorithm The line is rawn between two oints (, ) an (, ) ( Sloe ) k ( = k + m) ( ) Each time we ste in irection, we shoul increment with k. Otherwise the error in increases with k. If the error surasses.5, the line has become closer to the net value, so we a to simultaneousl ecreasing the error b function line(,,, ) int elta := abs( ) int elta := abs( ) real error := real eltaerr := elta / elta int := for from to lot(,) error := error + eltaerr if error.5 := + error := error. See also htt://en.wikieia.org/wiki/bresenham's_line_algorithm Ulf Assarsson 6 Bresenham s line rawing algorithm Now, convert algorithm to onl using integer comutations The trick we use is to multil all the fractional numbers above b (, ), which enables us to eress them as integers. The onl roblem remaining is the constant.5 to eal with this, we multil both sies of the inequalit b Ol float version: function line(,,, ) int elta := abs( ) int elta := abs( ) real error := real eltaerr := elta / elta int := for from to lot(,) error := error + eltaerr if error.5 := + error := error. New integer version: function line(,,, ) int elta := abs( ) int elta := abs( ) real error := real eltaerr := elta int := for from to lot(,) error := error + eltaerr if *error elta := + error := error elta Ulf Assarsson 6 Comlete Bresenham s line rawing algorithm function line(,,, ) boolean stee := abs( ) > abs( ) if stee then swa(, ) swa(, ) if > then swa(, ) swa(, ) int elta := int elta := abs( ) int error := int ste int := if < then ste := else ste := for from to if stee then lot(,) else lot(,) error := error + elta if error elta := + ste error := error elta The first case is allowing us to raw lines that still sloe ownwars, but hea in the oosite irection. I.e., swaing the initial oints if >. To raw lines that go u, we check if >= ; if so, we ste b instea of. To be able to raw lines with a sloe less than one, we take avantage of the fact that a stee line can be reflecte across the line = to obtain a line with a small sloe. The effect is to switch the an variables. Ulf Assarsson 6 ALL FOLLOWNG SLIDES ARE NOT PART OF THE COURSE, BUT BONUSSLIDES PROVIDING DIFFERENT EXPLANATIONS IF THE PREVIOUS SLIDES ARE NOT ENOUGH. Most of the following slies are from E Angel Professor of Comuter Science, Electrical an Comuter Engineering, an Meia Arts Universit of New Meico Scalars Nee three basic elements in geometr Scalars, Vectors, Points Scalars can be efine as members of sets which can be combine b two oerations (aition an multilication) obeing some funamental aioms (associativit, commutivit, inverses) Eamles inclue the real an comle number sstems uner the orinar rules with which we are familiar Scalars alone have no geometric roerties Vector Oerations Phsical efinition: a vector is a quantit with two attributes Direction Magnitue Eamles inclue Force Velocit Directe line segments Most imortant eamle for grahics Can ma to other tes Ever vector can be multilie b a scalar There is a ero vector Zero magnitue, unefine orientation The sum of an two vectors is a vector v v v v u w 9

10 79 Vectors Lack Position These vectors are ientical Same length an magnitue Vectors insufficient for geometr Nee oints Points Location in sace Oerations allowe between oints an vectors Pointoint subtraction iels a vector Equivalent to ointvector aition v=pq P=v+Q Affine Saces Point + a vector sace Oerations Vectorvector aition Scalarvector multilication Pointvector aition Scalarscalar oerations For an oint efine P = P P = (ero vector) Lines Consier all oints of the form P()=P + Set of all oints that ass through P in the irection of the vector Parametric Form This form is known as the arametric form of the line More robust an general than other forms Etens to curves an surfaces Twoimensional forms Elicit: = k + m Imlicit: a + b +c = Parametric: () = + () () = + () Ras an Line Segments If >=, then P() is the ra leaving P in the irection If we use two oints to efine v, then P( ) = Q + (RQ)=Q+v =R + ()Q For <=<= we get all the oints on the line segment joining R an Q

11 79 Conveit An object is conve iff for an two oints in the object all oints on the line segment between these oints are also in the object Q P conve P Q not conve Affine Sums Consier the sum P= P + P +..+ n P n Can show b inuction that this sum makes sense iff n = in which case we have the affine sum of the oints P,P,..P n If, in aition, i >=, we have the conve hull of P,P,..P n Conve Hull Consier the linear combination P= P + P +..+ n P n If n = (in which case we have the affine sum of the oints P,P,..P n ) an if i >=, we have the conve hull of P,P,..P n Smallest conve object containing P,P,..P n Planes A lane can be efine b a oint an two vectors or b three oints v Q R u R P(,b)=R+u+bv P(,b)=R+(QR)+b(PQ) P conve sum of P an Q Triangles conve sum of S() an R Normals Ever lane has a vector n normal (erenicular, orthogonal) to it From oint/vector form P(,b)=R+u+bv we know we can use the cross rouct to fin n = u v Plane equation: n =, where = n an is an oint in the lane for <=,b<=, we get all oints in triangle P v u

12 79 Normal for Triangle Frames lane n ( ) = n = ( ) ( ) normalie n n/ n n A coorinate sstem is insufficient to reresent oints If we work in an affine sace we can a a single oint, the origin, to the basis vectors to form a frame Note that righthan rule etermines outwar face v P v v 3 Reresenting one basis in terms of another Each of the basis vectors, u,u, u3, are vectors that can be reresente in terms of the first basis u = g v +g v +g 3 v 3 u = g v +g v +g 3 v 3 u 3 = g 3 v +g 3 v +g 33 v 3 v Matri Form The coefficients efine a 3 3 matri g M = g g an the bases can be relate b a=m T b g g g g g g 33 Translation Move (translate, islace) a oint to a new P location P How man was? Although we can move a oint to a new location in infinite was, when we move man oints there is usuall onl one wa Dislacement etermine b a vector Three egrees of freeom P =P+ object translation: ever oint islace b same vector

13 79 Translation Using Reresentations Using the homogeneous coorinate reresentation in some frame =[ ] T =[ ] T =[ ] T Hence = + or =+ =+ =+ note that this eression is in four imensions an eresses oint = vector + oint Translation Matri We can also eress translation using a 4 4 matri T in homogeneous coorinates =T where T = T(,, ) = This form is better for imlementation because all affine transformations can be eresse this wa an multile transformations can be concatenate together Homogeneous Coorinates The homogeneous coorinates form for a three imensional oint [ ] is given as =[ w] T =[w w w w] T We return to a three imensional oint (for w) b /w /w /w If w=, the reresentation is that of a vector Note that homogeneous coorinates relaces oints in three imensions b lines through the origin in four imensions For w=, the reresentation of a oint is [ ] Homogeneous Coorinates an Comuter Grahics Homogeneous coorinates are ke to all comuter grahics sstems All stanar transformations (rotation, translation, scaling) can be imlemente with matri multilications using 4 4 matrices Harware ieline works with 4 imensional reresentations For orthograhic viewing, we can maintain w= for vectors an w= for oints For ersective we nee a ersective ivision Rotation about the ais Rotation about ais in three imensions leaves all oints with the same Equivalent to rotation in two imensions in lanes of constant = cos q sin q = sin q + cos q = or in homogeneous coorinates =R (q) Rotation Matri cos q sin q R = R (q) = sin q cos q 3

14 79 Rotation about an aes Same argument as for rotation about ais For rotation about ais, is unchange For rotation about ais, is unchange R = R (q) = cos q R = R (q) = sin q cos q sin q sin q cos q sin q cos q s S = S(s, s, s ) = Scaling Ean or contract along each ais (fie oint of origin) =s =s =s =S s s Reflection corresons to negative scale factors s = s = original s = s = s = s = Inverses Although we coul comute inverse matrices b general formulas, we can use simle geometric observations Translation: T (,, ) = T(,, ) Rotation: R (q) = R(q) Hols for an rotation matri Note that since cos(q) = cos(q) an sin( q)=sin(q) R (q) = R T (q) Scaling: S (s, s, s ) = S(/s, /s, /s ) Concatenation Orer of Transformations We can form arbitrar affine transformation matrices b multiling together rotation, translation, an scaling matrices Because the same transformation is alie to man vertices, the cost of forming a matri M=ABCD is not significant comare to the cost of comuting M for man vertices The ifficult art is how to form a esire transformation from the secifications in the alication Note that matri on the right is the first alie Mathematicall, the following are equivalent = ABC = A(B(C)) Note man references use column matrices to reresent oints. In terms of column matrices T = T C T B T A T 4

15 79 General Rotation About the Origin Rotation About a Fie Point other than the Origin A rotation b q about an arbitrar ais can be ecomose into the concatenation of rotations about the,, an aes R(q) = R (q ) R (q ) R (q ) q q q are calle the Euler angles q v Move fie oint to origin Rotate Move fie oint back M = T( f ) R(q) T( f ) Note that rotations o not commute We can use rotations in another orer but with ifferent angles Instancing In moeling, we often start with a simle object centere at the origin, oriente with the ais, an at a stanar sie We al an instance transformation to its vertices to Scale Orient Locate Shear Helful to a one more basic transformation Equivalent to ulling faces in oosite irections Shear Matri Consier simle shear along ais = + cot q = = OenGL Transformations H(q) = cot q 5

16 79 Objectives Learn how to carr out transformations in OenGL Rotation Translation Scaling Introuce OenGL matri moes Moelview Projection OenGL Matrices In OenGL matrices are art of the state Multile tes MoelView (GL_MODELVIEW) Projection (GL_PROJECTION) Teture (GL_TEXTURE) (ignore for now) Color(GL_COLOR) (ignore for now) Single set of functions for maniulation Select which to maniulate b glmatrimoe(gl_modelview); glmatrimoe(gl_projection); Current Transformation Matri (CTM) Concetuall there is a 4 4 homogeneous coorinate matri, the current transformation matri (CTM) that is art of the state an is alie to all vertices that ass own the ieline The CTM is efine in the user rogram an loae into a transformation unit C =C vertices CTM vertices CTM oerations The CTM can be altere either b loaing a new CTM or b ostmutilication Loa an ientit matri: C I Loa an arbitrar matri: C M Loa a translation matri: C T Loa a rotation matri: C R Loa a scaling matri: C S Postmultil b an arbitrar matri: C CM Postmultil b a translation matri: C CT Postmultil b a rotation matri: C C R Postmultil b a scaling matri: C C S Rotation about a Fie Point Start with ientit matri: C I Move fie oint to origin: C CT Rotate: C CR Move fie oint back: C CT Result: C = TR T which is backwars. This result is a consequence of oing ostmultilications. Let s tr again. Reversing the Orer We want C = T R T so we must o the oerations in the following orer C I C CT C CR C CT Each oeration corresons to one function call in the rogram. Note that the last oeration secifie is the first eecute in the rogram 6

17 79 CTM in OenGL OenGL has a moelview an a rojection matri in the ieline which are concatenate together to form the CTM Can maniulate each b first setting the correct matri moe Rotation, Translation, Scaling Loa an ientit matri: glloaientit() Multil on right: glrotatef(theta, v, v, v) theta in egrees, (v, v, v) efine ais of rotation gltranslatef(,, ) glscalef( s, s, s) Each has a float (f) an ouble () format (glscale) Eamle Rotation about ais b 3 egrees with a fie oint of (.,., 3.) glmatrimoe(gl_modelview); glloaientit(); gltranslatef(.,., 3.); glrotatef(3.,.,.,.); gltranslatef(.,., 3.); Remember that last matri secifie in the rogram is the first alie Arbitrar Matrices Can loa an multil b matrices efine in the alication rogram glloamatrif(m) glmultmatrif(m) The matri m is a one imension arra of 6 elements which are the comonents of the esire 4 4 matri store b columns In glmultmatrif, m multilies the eisting matri on the right Matri Stacks In man situations we want to save transformation matrices for use later Traversing hierarchical ata structures (Chater ) Avoiing state changes when eecuting isla lists OenGL maintains stacks for each te of matri Access resent te (as set b glmatrimoe) b glpushmatri() glpomatri() Reaing Back Matrices Can also access matrices (an other arts of the state) b quer functions glgetintegerv glgetfloatv glgetbooleanv glgetdoublev glisenable For matrices, we use as ouble m[6]; glgetfloatv(gl_modelview, m); 7

18 79 Using the Moelview Matri In OenGL the moelview matri is use to Position the camera Can be one b rotations an translations but is often easier to use glulookat Buil moels of objects The rojection matri is use to efine the view volume an to select a camera lens Quaternions Etension of imaginar numbers from two to three imensions Requires one real an three imaginar comonents i, j, k q=q +q i+q j+q 3 k Quaternions can eress rotations on shere smoothl an efficientl. Process: Moelview matri quaternion Carr out oerations with quaternions Quaternion Moelview matri Objectives Comuter Viewing E Angel Professor of Comuter Science, Electrical an Comuter Engineering, an Meia Arts Universit of New Meico Introuce the mathematics of rojection Introuce OenGL viewing functions Look at alternate viewing APIs Comuter Viewing There are three asects of the viewing rocess, all of which are imlemente in the ieline, Positioning the camera Setting the moelview matri Selecting a lens Setting the rojection matri Cliing Setting the view volume (efault is unit cube, R 3, [,]) Default Projection Default rojection is orthogonal clie out = 8

19 79 Moving the Camera Frame If we want to visualie object with both ositive an negative values we can either Move the camera in the ositive irection Translate the camera frame Move the objects in the negative irection Translate the worl frame Both of these views are equivalent an are etermine b the moelview matri Want a translation (gltranslatef(.,.,);) > Moving the Camera We can move the camera to an esire osition b a sequence of rotations an translations Eamle: sie view Rotate the camera Move it awa from origin Moelview matri C = TR OenGL coe Remember that last transformation secifie is first to be alie glmatrimoe(gl_modelview) glloaientit(); gltranslatef(.,., ); glrotatef(9.,.,.,.); The LookAt Function The GLU librar contains the function glulookat to form the require moelview matri through a simle interface Note the nee for setting an u irection Still nee to initialie Can concatenate with moeling transformations Eamle: isometric view of cube aligne with aes glmatrimoe(gl_modelview): glloaientit(); glulookat(.,.,.,.,.,.,.,...); glulookat gllookat(ee, ee, ee, at, at, at, u, u, u) Other Viewing APIs The LookAt function is onl one ossible API for ositioning the camera Others inclue View reference oint, view lane normal, view u (PHIGS, GKS3D) Yaw, itch, roll Elevation, aimuth, twist Direction angles 9

20 79 OenGL Orthogonal Viewing OenGL Persective glortho(left,right,bottom,to,near,far) glfrustum(left,right,bottom,to,near,far ) near an far measure from camera Using Fiel of View With glfrustum it is often ifficult to get the esire view gluperective(fov, asect, near, far) often rovies a better interface front lane asect = w/h Projections elaine ifferentl Rea the following slies about orthogonal an ersective rojections b our selves The resent the same thing, but elaine ifferentl Projections an Normaliation The efault rojection in the ee (camera) frame is orthogonal For oints within the efault view volume = = = Most grahics sstems use view normaliation All other views are converte to the efault view b transformations that etermine the rojection matri Allows use of the same ieline for all views Homogeneous Coorinate Reresentation = = = w = efault orthograhic rojection M = = M In ractice, we can let M = I an set the term to ero later

21 79 Simle Persective Center of rojection at the origin Projection lane =, < Persective Equations Consier to an sie views / = / = / = Homogeneous Coorinate Form M = consier q = M where q = = / / Persective Division However w, so we must ivie b w to return from homogeneous coorinates This ersective ivision iels = / = / = the esire ersective equations We will consier the corresoning cliing volume with the OenGL functions Normaliation Rather than erive a ifferent rojection matri for each te of rojection, we can convert all rojections to orthogonal rojections with the efault view volume This strateg allows us to use stanar transformations in the ieline an makes for efficient cliing moelview transformation nonsingular Pieline View cliing against efault cube rojection transformation rojection 3D D ersective ivision 4D 3D

22 79 Notes We sta in fourimensional homogeneous coorinates through both the moelview an rojection transformations Both these transformations are nonsingular Default to ientit matrices (orthogonal view) Normaliation lets us cli against simle cube regarless of te of rojection Dela final rojection until en Imortant for hiensurface removal to retain eth information as long as ossible Orthogonal Normaliation glortho(left,right,bottom,to,near,far) normaliation fin transformation to convert secifie cliing volume to efault Orthogonal Matri Two stes Move center to origin T((left+right)/, (bottom+to)/,(near+far)/)) Scale to have sies of length S(/(leftright),/(tobottom),/(nearfar)) right left P = ST = to bottom near far right left right left to + bottom to bottom far + near far near Final Projection Set = Equivalent to the homogeneous coorinate transformation M orth = Hence, general orthogonal rojection in 4D is P = M orth ST General Shear Shear Matri shear ( values unchange) to view sie view H(q,f) = Projection matri General case: cot θ cot φ P = M orth H(q,f) P = M orth STH(q,f)

23 79 Effect on Cliing The rojection matri P = STH transforms the original cliing volume to the efault cliing volume object to view = Simle Persective Consier a simle ersective with the COP at the origin, the near cliing lane at =, an a 9 egree fiel of view etermine b the lanes =, = DOP cliing volume near lane far lane = = DOP = istorte object (rojects correctl) Persective Matrices Simle rojection matri in homogeneous coorinates M = Note that this matri is ineenent of the far cliing lane Generaliation N = α β after ersective ivision, the oint (,,, ) goes to = / = / Z = (+b/) which rojects orthogonall to the esire oint regarless of an b If we ick near + far = far near near far b = near far Picking an b Normaliation Transformation istorte object rojects correctl the near lane is mae to = the far lane is mae to = an the sies are mae to =, = Hence the new cliing volume is the efault cliing volume original cliing volume original object new cliing volume 3

24 79 Normaliation an HienSurface Removal Although our selection of the form of the ersective matrices ma aear somewhat arbitrar, it was chosen so that if > in the original cliing volume then the for the transforme oints > Thus hien surface removal works if we first al the normaliation transformation However, the formula = (+b/) imlies that the istances are istorte b the normaliation which can cause numerical roblems eseciall if the near istance is small OenGL Persective glfrustum allows for an unsmmetric viewing frustum (although glupersective oes not) OenGL Persective Matri The normaliation in glfrustum requires an initial shear to form a right viewing rami, followe b a scaling to get the normalie ersective volume. Finall, the ersective matri results in neeing onl a final orthogonal transformation P = NSH our reviousl efine ersective matri shear an scale Wh o we o it this wa? Normaliation allows for a single ieline for both ersective an orthogonal viewing We sta in four imensional homogeneous coorinates as long as ossible to retain threeimensional information neee for hiensurface removal an shaing We simlif cliing 4

Realtime 3D Computer Graphics Virtual Reality

Realtime 3D Computer Graphics Virtual Reality Realtime 3D Comuter Grahics Virtual Realit Viewing an rojection Classical an General Viewing Transformation Pieline CPU CPU Pol. Pol. DL DL Piel Piel Per Per Verte Verte Teture Teture Raster Raster Frag

More information

Vectors and Transforms

Vectors and Transforms Skämtbild om matte å KTH-animationskurs Vectors and Transforms In 3D Grahics MAP Reetition of the Rendering Pieline Geometry - er vertex: Lighting (colors) Screen sace ositions light blue Geometry red

More information

What is Perspective?

What is Perspective? Fall 25 M ss =M screen * M ersective * M view What is Persective? A mechanism for ortraing 3D in 2D True Persective corresons to rojection onto a lane True Persective corresons to an ieal camera image

More information

Computer Graphics. Viewing. Fundamental Types of Viewing. Perspective views. Parallel views. October 12, finite COP (center of projection)

Computer Graphics. Viewing. Fundamental Types of Viewing. Perspective views. Parallel views. October 12, finite COP (center of projection) Comuter Grahics Viewing October 2, 25 htt://www.hallm.ac.kr/~sunkim/teach/25/cga Funamental Tes of Viewing Persective views finite COP (center of rojection) Parallel views COP at infinit DOP (irection

More information

Raster Graphics Algorithms

Raster Graphics Algorithms Overview of Grahics Pieline Raster Grahics Algorithms D scene atabase traverse geometric moel transform to worl sace transform to ee sace scan conversion Line rasterization Bresenham s Mioint line algorithm

More information

Vectors and Transforms

Vectors and Transforms Skämtbild om matte å KTH-animationskurs Vectors and Transforms In 3D Grahics Change of Lecture Room Week 2: Wed 2/11: HC1 Fri 4/11: HA1 Thereafter HC1 all times excet: Week 5: Fri: HC3 Week 7: Fri: HC3

More information

To Do. Computer Graphics (Fall 2004) Course Outline. Course Outline. Motivation. Motivation

To Do. Computer Graphics (Fall 2004) Course Outline. Course Outline. Motivation. Motivation Comuter Grahics (Fall 24) COMS 416, Lecture 3: ransformations 1 htt://www.cs.columbia.edu/~cs416 o Do Start (thinking about) assignment 1 Much of information ou need is in this lecture (slides) Ask A NOW

More information

CS 450: COMPUTER GRAPHICS 2D TRANSFORMATIONS SPRING 2016 DR. MICHAEL J. REALE

CS 450: COMPUTER GRAPHICS 2D TRANSFORMATIONS SPRING 2016 DR. MICHAEL J. REALE CS 45: COMUTER GRAHICS 2D TRANSFORMATIONS SRING 26 DR. MICHAEL J. REALE INTRODUCTION Now that we hae some linear algebra under our resectie belts, we can start ug it in grahics! So far, for each rimitie,

More information

CS5620 Intro to Computer Graphics

CS5620 Intro to Computer Graphics CS560 Reminder - Pieline Polgon at [(,9), (5,7), (8,9)] Polgon at [ ] D Model Transformations Reminder - Pieline Object Camera Cli Normalied device Screen Inut: Polgons in normalied device Model-view Projection

More information

Computer Graphics. Computer Graphics. Lecture 3 Line & Circle Drawing

Computer Graphics. Computer Graphics. Lecture 3 Line & Circle Drawing Comuter Grahics Comuter Grahics Lecture 3 Line & Circle Drawing Comuter Grahics Towards the Ideal Line We can onl do a discrete aroimation Illuminate iels as close to the true ath as ossible, consider

More information

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo Computer Graphic Bing-Yu Chen National Taiwan Univerit The Univerit of Toko Geometrical Tranformation Mathematical reliminarie 2D Tranformation Homogeneou Coorinate & Matri Repreentation 3D Tranformation

More information

CS 548: COMPUTER GRAPHICS DRAWING LINES AND CIRCLES SPRING 2015 DR. MICHAEL J. REALE

CS 548: COMPUTER GRAPHICS DRAWING LINES AND CIRCLES SPRING 2015 DR. MICHAEL J. REALE CS 548: COMPUTER GRAPHICS DRAWING LINES AND CIRCLES SPRING 05 DR. MICHAEL J. REALE OPENGL POINTS AND LINES OPENGL POINTS AND LINES In OenGL, there are different constants used to indicate what ind of rimitive

More information

4.2 Implicit Differentiation

4.2 Implicit Differentiation 6 Chapter 4 More Derivatives 4. Implicit Differentiation What ou will learn about... Implicitl Define Functions Lenses, Tangents, an Normal Lines Derivatives of Higher Orer Rational Powers of Differentiable

More information

CS 428: Fall Introduction to. Geometric Transformations. Andrew Nealen, Rutgers, /15/2010 1

CS 428: Fall Introduction to. Geometric Transformations. Andrew Nealen, Rutgers, /15/2010 1 CS 428: Fall 21 Introduction to Comuter Grahics Geometric Transformations Andrew Nealen, Rutgers, 21 9/15/21 1 Toic overview Image formation and OenGL (last week) Modeling the image formation rocess OenGL

More information

Viewing Transformations I Comp 535

Viewing Transformations I Comp 535 Viewing Transformations I Comp 535 Motivation Want to see our virtual 3-D worl on a 2-D screen 2 Graphics Pipeline Moel Space Moel Transformations Worl Space Viewing Transformation Ee/Camera Space Projection

More information

Computer Graphics. Geometric Transformations

Computer Graphics. Geometric Transformations Contents coordinate sstems scalar values, points, vectors, matrices right-handed and left-handed coordinate sstems mathematical foundations transformations mathematical descriptions of geometric changes,

More information

Computer Graphics. Geometric Transformations

Computer Graphics. Geometric Transformations Computer Graphics Geometric Transformations Contents coordinate sstems scalar values, points, vectors, matrices right-handed and left-handed coordinate sstems mathematical foundations transformations mathematical

More information

CS335 Fall 2007 Graphics and Multimedia. 2D Drawings: Lines

CS335 Fall 2007 Graphics and Multimedia. 2D Drawings: Lines CS335 Fall 007 Grahics and Multimedia D Drawings: Lines Primitive Drawing Oerations Digital Concets of Drawing in Raster Arras PIXEL is a single arra element at x, - No smaller drawing unit exists Px,

More information

Computer Viewing and Projection. Overview. Computer Viewing. David Carr Fundamentals of Computer Graphics Spring 2004 Based on Slides by E.

Computer Viewing and Projection. Overview. Computer Viewing. David Carr Fundamentals of Computer Graphics Spring 2004 Based on Slides by E. INSTITUTIONEN FÖR SYSTEMTEKNIK LULEÅ TEKNISKA UNIVERSITET Computer Viewing and Projection David Carr Fundamentals of Computer Graphics Spring 24 Based on Slides by E. Angel Projection 1 L Overview Computer

More information

Overview. Viewing and perspectives. Planar Geometric Projections. Classical Viewing. Classical views Computer viewing Perspective normalization

Overview. Viewing and perspectives. Planar Geometric Projections. Classical Viewing. Classical views Computer viewing Perspective normalization Overview Viewing and perspectives Classical views Computer viewing Perspective normalization Classical Viewing Viewing requires three basic elements One or more objects A viewer with a projection surface

More information

Vectors and Transforms

Vectors and Transforms Skätbild o atte å KTH-aniationskurs Vectors and Transfors In 3D Grahics Course Structure 14 lectures Book is the verbal forat / ore eticulous elanations Lecture slides are onl short suar Perhas not enough

More information

Transformations II. Arbitrary 3D Rotation. What is its inverse? What is its transpose? Can we constructively elucidate this relationship?

Transformations II. Arbitrary 3D Rotation. What is its inverse? What is its transpose? Can we constructively elucidate this relationship? Utah School of Computing Fall 25 Transformations II CS46 Computer Graphics From Rich Riesenfeld Fall 25 Arbitrar 3D Rotation What is its inverse? What is its transpose? Can we constructivel elucidate this

More information

Reading for This Module. Viewing. Using Transformations. Viewing. University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013

Reading for This Module. Viewing. Using Transformations. Viewing. University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Universit of British Columbia CPSC 34 Computer Graphics Jan-Apr 23 Tamara Munner Reaing for This Moule FCG Chapter 7 Viewing FCG Section 6.3. Winowing Transforms Viewing http://www.ugra.cs.ubc.ca/~cs34/vjan23

More information

Remember: The equation of projection. Imaging Geometry 1. Basic Geometric Coordinate Transforms. C306 Martin Jagersand

Remember: The equation of projection. Imaging Geometry 1. Basic Geometric Coordinate Transforms. C306 Martin Jagersand Imaging Geometr 1. Basic Geometric Coordinate Transorms emember: The equation o rojection Cartesian coordinates: (,, z) ( z, z ) C36 Martin Jagersand How do we develo a consistent mathematical ramework

More information

Computer Viewing. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Computer Viewing. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science Computer Viewing CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science 1 Objectives Introduce the mathematics of projection Introduce OpenGL viewing functions Look at

More information

5.8.3 Oblique Projections

5.8.3 Oblique Projections 278 Chapter 5 Viewing y (, y, ) ( p, y p, p ) Figure 537 Oblique projection P = 2 left right 0 0 left+right left right 0 2 top bottom 0 top+bottom top bottom far+near far near 0 0 far near 2 0 0 0 1 Because

More information

Graphics Pipeline : Geometric Operations

Graphics Pipeline : Geometric Operations Graphics Pipeline : Geometric Operations Uniersit of Calgar GraphicsJungle Project CPSC 587 25 page Vieing transformation Tools for creating an manipulating a camera that prouces pictures of a 3D scene

More information

Figure 1: 2D arm. Figure 2: 2D arm with labelled angles

Figure 1: 2D arm. Figure 2: 2D arm with labelled angles 2D Kinematics Consier a robotic arm. We can sen it commans like, move that joint so it bens at an angle θ. Once we ve set each joint, that s all well an goo. More interesting, though, is the question of

More information

Announcements. Introduction to Cameras. The Key to Axis Angle Rotation. Axis-Angle Form (review) Axis Angle (4 steps) Mechanics of Axis Angle

Announcements. Introduction to Cameras. The Key to Axis Angle Rotation. Axis-Angle Form (review) Axis Angle (4 steps) Mechanics of Axis Angle Ross Beerige Bruce Draper Introuction to Cameras September th 25 Announcements PA ue eek from Tuesa Q: hat i I mean b robust I/O? Hanle arious numbers of erte/face features Check for count matches Goo

More information

What does OpenGL do?

What does OpenGL do? Theor behind Geometrical Transform What does OpenGL do? So the user specifies a lot of information Ee Center Up Near, far, UP EE Left, right top, bottom, etc. f b CENTER left right top bottom What does

More information

Three-Dimensional Graphics III. Guoying Zhao 1 / 67

Three-Dimensional Graphics III. Guoying Zhao 1 / 67 Computer Graphics Three-Dimensional Graphics III Guoying Zhao 1 / 67 Classical Viewing Guoying Zhao 2 / 67 Objectives Introduce the classical views Compare and contrast image formation by computer with

More information

CSE328 Fundamentals of Computer Graphics: Theory, Algorithms, and Applications

CSE328 Fundamentals of Computer Graphics: Theory, Algorithms, and Applications CSE328 Fundamentals of Computer Graphics: Theor, Algorithms, and Applications Hong in State Universit of New York at Ston Brook (Ston Brook Universit) Ston Brook, New York 794-44 Tel: (63)632-845; Fa:

More information

Try It. Implicit and Explicit Functions. Video. Exploration A. Differentiating with Respect to x

Try It. Implicit and Explicit Functions. Video. Exploration A. Differentiating with Respect to x SECTION 5 Implicit Differentiation Section 5 Implicit Differentiation Distinguish between functions written in implicit form an eplicit form Use implicit ifferentiation to fin the erivative of a function

More information

Computer Viewing Computer Graphics I, Fall 2008

Computer Viewing Computer Graphics I, Fall 2008 Computer Viewing 1 Objectives Introduce mathematics of projection Introduce OpenGL viewing functions Look at alternate viewing APIs 2 Computer Viewing Three aspects of viewing process All implemented in

More information

Computer Graphics Inf4/MSc. Computer Graphics. Lecture 6 View Projection Taku Komura

Computer Graphics Inf4/MSc. Computer Graphics. Lecture 6 View Projection Taku Komura Computer Graphics Lecture 6 View Projection Taku Komura 1 Overview 1. View transformation 2. Rasterisation Implementation of viewing. Transform into camera coorinates. Perform projection into view volume

More information

Implicit and Explicit Functions

Implicit and Explicit Functions 60_005.q //0 :5 PM Page SECTION.5 Implicit Differentiation Section.5 EXPLORATION Graphing an Implicit Equation How coul ou use a graphing utilit to sketch the graph of the equation? Here are two possible

More information

Viewing and Modeling

Viewing and Modeling Viewing and Modeling Computer Science Department The Universit of Texas at Austin A Simplified Graphics ipeline Application Vertex batching & assembl Triangle assembl Triangle clipping NDC to window space

More information

CS770/870 Spring 2017 Transformations

CS770/870 Spring 2017 Transformations CS770/870 Spring 2017 Transformations Coordinate sstems 2D Transformations Homogeneous coordinates Matrices, vectors, points Coordinate Sstems Coordinate sstems used in graphics Screen coordinates: the

More information

Modeling Transformations

Modeling Transformations Modeling Transformations Michael Kazhdan (601.457/657) HB Ch. 5 FvDFH Ch. 5 Overview Ra-Tracing so far Modeling transformations Ra Tracing Image RaTrace(Camera camera, Scene scene, int width, int heigh,

More information

Animação e Visualização Tridimensional. Collision Detection Corpo docente de AVT / CG&M / DEI / IST / UTL

Animação e Visualização Tridimensional. Collision Detection Corpo docente de AVT / CG&M / DEI / IST / UTL Animação e Visualização Triimensional Collision Detection Collision Hanling Collision Detection Collision Determination Collision Response Collision Hanling Collision Detection Collision Determination

More information

Cross products Line segments The convex combination of two distinct points p

Cross products Line segments The convex combination of two distinct points p CHAPTER Comutational Geometry Is the branch of comuter science that studies algorithms for solving geometric roblems. Has alications in many fields, including comuter grahics robotics, VLSI design comuter

More information

Simple example. Analysis of programs with pointers. Points-to relation. Program model. Points-to graph. Ordering on points-to relation

Simple example. Analysis of programs with pointers. Points-to relation. Program model. Points-to graph. Ordering on points-to relation Simle eamle Analsis of rograms with ointers := 5 tr := @ *tr := 9 := rogram S1 S2 S3 S4 deendences What are the deendences in this rogram? Problem: just looking at variable names will not give ou the correct

More information

521493S Computer Graphics Exercise 3 (Chapters 6-8)

521493S Computer Graphics Exercise 3 (Chapters 6-8) 521493S Comuter Grahics Exercise 3 (Chaters 6-8) 1 Most grahics systems and APIs use the simle lighting and reflection models that we introduced for olygon rendering Describe the ways in which each of

More information

Determining the 2d transformation that brings one image into alignment (registers it) with another. And

Determining the 2d transformation that brings one image into alignment (registers it) with another. And Last two lectures: Representing an image as a weighted combination of other images. Toda: A different kind of coordinate sstem change. Solving the biggest problem in using eigenfaces? Toda Recognition

More information

Realtime 3D Computer Graphics & Virtual Reality. Viewing

Realtime 3D Computer Graphics & Virtual Reality. Viewing Realtime 3D Computer Graphics & Virtual Realit Viewing Transformation Pol. Per Verte Pipeline CPU DL Piel Teture Raster Frag FB v e r t e object ee clip normalied device Modelview Matri Projection Matri

More information

1 Transformations. Chapter 1. Transformations. Department of Computer Science and Engineering 1-1

1 Transformations. Chapter 1. Transformations. Department of Computer Science and Engineering 1-1 Transformations 1-1 Transformations are used within the entire viewing pipeline: Projection from world to view coordinate system View modifications: Panning Zooming Rotation 1-2 Transformations can also

More information

Modeling Transformations

Modeling Transformations Modeling Transformations Michael Kazhdan (601.457/657) HB Ch. 5 FvDFH Ch. 5 Announcement Assignment 2 has been posted: Due: 10/24 ASAP: Download the code and make sure it compiles» On windows: just build

More information

Lecture 4: Viewing. Topics:

Lecture 4: Viewing. Topics: Lecture 4: Viewing Topics: 1. Classical viewing 2. Positioning the camera 3. Perspective and orthogonal projections 4. Perspective and orthogonal projections in OpenGL 5. Perspective and orthogonal projection

More information

Last Time. Correct Transparent Shadow. Does Ray Tracing Simulate Physics? Does Ray Tracing Simulate Physics? Refraction and the Lifeguard Problem

Last Time. Correct Transparent Shadow. Does Ray Tracing Simulate Physics? Does Ray Tracing Simulate Physics? Refraction and the Lifeguard Problem Graphics Pipeline: Projective Last Time Shadows cast ra to light stop after first intersection Reflection & Refraction compute direction of recursive ra Recursive Ra Tracing maimum number of bounces OR

More information

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner GLOBAL EDITION Interactive Computer Graphics A Top-Down Approach with WebGL SEVENTH EDITION Edward Angel Dave Shreiner This page is intentionall left blank. 4.10 Concatenation of Transformations 219 in

More information

What and Why Transformations?

What and Why Transformations? 2D transformations What and Wh Transformations? What? : The geometrical changes of an object from a current state to modified state. Changing an object s position (translation), orientation (rotation)

More information

News. Projections and Picking. Transforming View Volumes. Projections recap. Basic Perspective Projection. Basic Perspective Projection

News. Projections and Picking. Transforming View Volumes. Projections recap. Basic Perspective Projection. Basic Perspective Projection Universit of British Columbia CPSC 44 Computer Graphics Projections and Picking Wed 4 Sep 3 project solution demo recap: projections projections 3 picking News Project solution eecutable available idea

More information

Uses of Transformations. 2D transformations Homogeneous coordinates. Transformations. Transformations. Transformations. Transformations and matrices

Uses of Transformations. 2D transformations Homogeneous coordinates. Transformations. Transformations. Transformations. Transformations and matrices Uses of Transformations 2D transformations Homogeneous coordinates odeling: position and resie parts of a comple model; Viewing: define and position the virtual camera Animation: define how objects move/change

More information

Announcements. Equation of Perspective Projection. Image Formation and Cameras

Announcements. Equation of Perspective Projection. Image Formation and Cameras Announcements Image ormation and Cameras Introduction to Computer Vision CSE 52 Lecture 4 Read Trucco & Verri: pp. 22-4 Irfanview: http://www.irfanview.com/ is a good Windows utilit for manipulating images.

More information

CS F-07 Objects in 2D 1

CS F-07 Objects in 2D 1 CS420-2010F-07 Objects in 2D 1 07-0: Representing Polgons We want to represent a simple polgon Triangle, rectangle, square, etc Assume for the moment our game onl uses these simple shapes No curves for

More information

Introduction to Computer Graphics 4. Viewing in 3D

Introduction to Computer Graphics 4. Viewing in 3D Introduction to Computer Graphics 4. Viewing in 3D National Chiao Tung Univ, Taiwan By: I-Chen Lin, Assistant Professor Textbook: E.Angel, Interactive Computer Graphics, 5 th Ed., Addison Wesley Ref: Hearn

More information

Transformations. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Transformations. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico Transformations Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico Angel: Interactive Computer Graphics 4E Addison-Wesley 25 1 Objectives

More information

Classical Mechanics Examples (Lagrange Multipliers)

Classical Mechanics Examples (Lagrange Multipliers) Classical Mechanics Examples (Lagrange Multipliers) Dipan Kumar Ghosh Physics Department, Inian Institute of Technology Bombay Powai, Mumbai 400076 September 3, 015 1 Introuction We have seen that the

More information

Image Formation. 2. Camera Geometry. Focal Length, Field Of View. Pinhole Camera Model. Computer Vision. Zoltan Kato

Image Formation. 2. Camera Geometry. Focal Length, Field Of View. Pinhole Camera Model. Computer Vision. Zoltan Kato Image Formation 2. amera Geometr omuter Vision oltan Kato htt://www.in.u-seged.hu/~kato seged.hu/~kato/ 3D Scene Surace Light (Energ) Source inhole Lens Imaging lane World Otics Sensor Signal amera: Sec

More information

Clipping. Administrative. Assignment 1 Gallery. Questions about previous lectures? Overview of graphics pipeline? Assignment 2

Clipping. Administrative. Assignment 1 Gallery. Questions about previous lectures? Overview of graphics pipeline? Assignment 2 Cliing MIT EECS 6.837 Frédo Durand and Seth Teller Some slides and images courtesy of Leonard McMillan MIT EECS 6.837, Teller and Durand 1 MIT EECS 6.837, Teller and Durand 2 Administrative Assignment

More information

Computer Graphics Chapter 7 Three-Dimensional Viewing Viewing

Computer Graphics Chapter 7 Three-Dimensional Viewing Viewing Computer Graphics Chapter 7 Three-Dimensional Viewing Outline Overview of Three-Dimensional Viewing Concepts The Three-Dimensional Viewing Pipeline Three-Dimensional Viewing-Coorinate Parameters Transformation

More information

CS Computer Graphics: Transformations & The Synthetic Camera

CS Computer Graphics: Transformations & The Synthetic Camera CS 543 - Computer Graphics: Transformations The Snthetic Camera b Robert W. Lindeman gogo@wpi.edu (with help from Emmanuel Agu ;-) Introduction to Transformations A transformation changes an objects Size

More information

Here are a couple of warnings to my students who may be here to get a copy of what happened on a day that you missed.

Here are a couple of warnings to my students who may be here to get a copy of what happened on a day that you missed. Preface Here are my online notes for my Calculus I course that I teach here at Lamar University. Despite the fact that these are my class notes, they shoul be accessible to anyone wanting to learn Calculus

More information

Exercises of PIV. incomplete draft, version 0.0. October 2009

Exercises of PIV. incomplete draft, version 0.0. October 2009 Exercises of PIV incomplete raft, version 0.0 October 2009 1 Images Images are signals efine in 2D or 3D omains. They can be vector value (e.g., color images), real (monocromatic images), complex or binary

More information

Today s class. Geometric objects and transformations. Informationsteknologi. Wednesday, November 7, 2007 Computer Graphics - Class 5 1

Today s class. Geometric objects and transformations. Informationsteknologi. Wednesday, November 7, 2007 Computer Graphics - Class 5 1 Toda s class Geometric objects and transformations Wednesda, November 7, 27 Computer Graphics - Class 5 Vector operations Review of vector operations needed for working in computer graphics adding two

More information

CS 4204 Computer Graphics

CS 4204 Computer Graphics CS 424 Computer Graphics 2D Transformations Yong Cao Virginia Tech References: Introduction to Computer Graphics course notes by Doug Bowman Interactive Computer Graphics, Fourth Edition, Ed Angle Transformations

More information

Transformations. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Transformations. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science Transformations CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science 1 Objectives Introduce standard transformations - Rotation - Translation - Scaling - Shear Derive

More information

Objectives. transformation. General Transformations. Affine Transformations. Notation. Pipeline Implementation. Introduce standard transformations

Objectives. transformation. General Transformations. Affine Transformations. Notation. Pipeline Implementation. Introduce standard transformations Objectives Transformations CS Interactive Computer Graphics Prof. David E. Breen Department of Computer Science Introduce standard transformations - Rotation - Translation - Scaling - Shear Derive homogeneous

More information

3D ENVIRONMENT MODELING AND MONITORING USING KINECTS FOR VIDEO SURVEILLANCE 1

3D ENVIRONMENT MODELING AND MONITORING USING KINECTS FOR VIDEO SURVEILLANCE 1 D ENVIRONMENT MODELING AND MONITORING USING KINECTS FOR VIDEO SURVEILLANCE 1 Bing-Chen Ma ( 馬秉辰 ) Institute o Comuter Science an Engineering National Chiao Tung University, Hsinchu, Taiwan Email: t110.cs01g@nctu.eu.tw

More information

Chap 7, 2009 Spring Yeong Gil Shin

Chap 7, 2009 Spring Yeong Gil Shin Three-Dimensional i Viewingi Chap 7, 29 Spring Yeong Gil Shin Viewing i Pipeline H d fi i d? How to define a window? How to project onto the window? Rendering "Create a picture (in a snthetic camera) Specification

More information

Computer Graphics. Jeng-Sheng Yeh 葉正聖 Ming Chuan University (modified from Bing-Yu Chen s slides)

Computer Graphics. Jeng-Sheng Yeh 葉正聖 Ming Chuan University (modified from Bing-Yu Chen s slides) Computer Graphics Jeng-Sheng Yeh 葉正聖 Ming Chuan Universit (modified from Bing-Yu Chen s slides) Viewing in 3D 3D Viewing Process Specification of an Arbitrar 3D View Orthographic Parallel Projection Perspective

More information

3D graphics rendering pipeline (1) 3D graphics rendering pipeline (3) 3D graphics rendering pipeline (2) 8/29/11

3D graphics rendering pipeline (1) 3D graphics rendering pipeline (3) 3D graphics rendering pipeline (2) 8/29/11 3D graphics rendering pipeline (1) Geometr Rasteriation 3D Coordinates & Transformations Prof. Aaron Lanterman (Based on slides b Prof. Hsien-Hsin Sean Lee) School of Electrical and Computer Engineering

More information

Multi-camera tracking algorithm study based on information fusion

Multi-camera tracking algorithm study based on information fusion International Conference on Avance Electronic Science an Technolog (AEST 016) Multi-camera tracking algorithm stu base on information fusion a Guoqiang Wang, Shangfu Li an Xue Wen School of Electronic

More information

CMSC 425: Lecture 16 Motion Planning: Basic Concepts

CMSC 425: Lecture 16 Motion Planning: Basic Concepts : Lecture 16 Motion lanning: Basic Concets eading: Today s material comes from various sources, including AI Game rogramming Wisdom 2 by S. abin and lanning Algorithms by S. M. LaValle (Chats. 4 and 5).

More information

Shuigeng Zhou. May 18, 2016 School of Computer Science Fudan University

Shuigeng Zhou. May 18, 2016 School of Computer Science Fudan University Query Processing Shuigeng Zhou May 18, 2016 School of Comuter Science Fudan University Overview Outline Measures of Query Cost Selection Oeration Sorting Join Oeration Other Oerations Evaluation of Exressions

More information

Homogeneous Coordinates

Homogeneous Coordinates COMS W4172 3D Math 2 Steven Feiner Department of Computer Science Columbia Universit New York, NY 127 www.cs.columbia.edu/graphics/courses/csw4172 Februar 1, 218 1 Homogeneous Coordinates w X W Y X W Y

More information

1. We ll look at: Types of geometrical transformation. Vector and matrix representations

1. We ll look at: Types of geometrical transformation. Vector and matrix representations Tob Howard COMP272 Computer Graphics and Image Processing 3: Transformations Tob.Howard@manchester.ac.uk Introduction We ll look at: Tpes of geometrical transformation Vector and matri representations

More information

3D Coordinates & Transformations

3D Coordinates & Transformations 3D Coordinates & Transformations Prof. Aaron Lanterman (Based on slides b Prof. Hsien-Hsin Sean Lee) School of Electrical and Computer Engineering Georgia Institute of Technolog 3D graphics rendering pipeline

More information

3D Viewing. With acknowledge to: Ed Angel. Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

3D Viewing. With acknowledge to: Ed Angel. Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico 3D Viewing With acknowledge to: Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico 1 Classical Viewing Viewing plane projectors Classical

More information

CS 106 Winter 2016 Craig S. Kaplan. Module 01 Processing Recap. Topics

CS 106 Winter 2016 Craig S. Kaplan. Module 01 Processing Recap. Topics CS 106 Winter 2016 Craig S. Kaplan Moule 01 Processing Recap Topics The basic parts of speech in a Processing program Scope Review of syntax for classes an objects Reaings Your CS 105 notes Learning Processing,

More information

You Can Do That. Unit 16. Motivation. Computer Organization. Computer Organization Design of a Simple Processor. Now that you have some understanding

You Can Do That. Unit 16. Motivation. Computer Organization. Computer Organization Design of a Simple Processor. Now that you have some understanding .. ou Can Do That Unit Computer Organization Design of a imple Clou & Distribute Computing (CyberPhysical, bases, Mining,etc.) Applications (AI, Robotics, Graphics, Mobile) ystems & Networking (Embee ystems,

More information

CS770/870 Spring 2017 Transformations

CS770/870 Spring 2017 Transformations CS770/870 Spring 2017 Transformations Coordinate sstems 2D Transformations Homogeneous coordinates Matrices, vectors, points 01/29/2017 1 Coordinate Sstems Coordinate sstems used in graphics Screen coordinates:

More information

Computer Graphics. P04 Transformations. Aleksandra Pizurica Ghent University

Computer Graphics. P04 Transformations. Aleksandra Pizurica Ghent University Computer Graphics P4 Transformations Aleksandra Pizurica Ghent Universit Telecommunications and Information Processing Image Processing and Interpretation Group Transformations in computer graphics Goal:

More information

Clustering Expression Data. Clustering Expression Data

Clustering Expression Data. Clustering Expression Data www.cs.washington.eu/ Subscribe if you Din t get msg last night Clustering Exression Data Why cluster gene exression ata? Tissue classification Fin biologically relate genes First ste in inferring regulatory

More information

Midterm Review. Wen-Chieh (Steve) Lin Department of Computer Science

Midterm Review. Wen-Chieh (Steve) Lin Department of Computer Science Midterm Review Wen-Chieh (Steve) Lin Department of Computer Science Administration Assignment due on /3 :59 PM Midterm eam on /6 (Monda) Lecture slides Chapter 3 ecluding 3.6 & 3.8 Chapter 6, 7, 8 Chapter

More information

Fitting Spheres to Range Data from 3D Imaging Systems

Fitting Spheres to Range Data from 3D Imaging Systems > PLAC THIS LI WITH OU PAP IDTIFICATIO UMB (DOUBL-CLICK H TO DIT) < Fitting Sheres to ange Data from 3D Imaging Systems Marek Franaszek Geraline S. Cheok Kamel S. Saii an Christoh Witzgall 3 Abstract Two

More information

Computer Graphics. Modelling in 2D. 2D primitives. Lines and Polylines. OpenGL polygon primitives. Special polygons

Computer Graphics. Modelling in 2D. 2D primitives. Lines and Polylines. OpenGL polygon primitives. Special polygons Computer Graphics Modelling in D Lecture School of EECS Queen Mar, Universit of London D primitives Digital line algorithms Digital circle algorithms Polgon filling CG - p.hao@qmul.ac.uk D primitives Line

More information

Cross products. p 2 p. p p1 p2. p 1. Line segments The convex combination of two distinct points p1 ( x1, such that for some real number with 0 1,

Cross products. p 2 p. p p1 p2. p 1. Line segments The convex combination of two distinct points p1 ( x1, such that for some real number with 0 1, CHAPTER 33 Comutational Geometry Is the branch of comuter science that studies algorithms for solving geometric roblems. Has alications in many fields, including comuter grahics robotics, VLSI design comuter

More information

Introduction to Computer Graphics with WebGL

Introduction to Computer Graphics with WebGL Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science Laboratory University of New Mexico 1 Computer Viewing

More information

8.6 Three-Dimensional Cartesian Coordinate System

8.6 Three-Dimensional Cartesian Coordinate System SECTION 8.6 Three-Dimensional Cartesian Coordinate Sstem 69 What ou ll learn about Three-Dimensional Cartesian Coordinates Distance and Midpoint Formulas Equation of a Sphere Planes and Other Surfaces

More information

Modeling Transformations Revisited

Modeling Transformations Revisited Modeling Transformations Revisited Basic 3D Transformations Translation Scale Shear Rotation 3D Transformations Same idea as 2D transformations o Homogeneous coordinates: (,,z,w) o 44 transformation matrices

More information

Perception of Shape from Shading

Perception of Shape from Shading 1 Percetion of Shae from Shading Continuous image brightness variation due to shae variations is called shading Our ercetion of shae deends on shading Circular region on left is erceived as a flat disk

More information

Rotation Matrices Three interpretations of rotational matrices Representing the coordinates of a point in two different frames

Rotation Matrices Three interpretations of rotational matrices Representing the coordinates of a point in two different frames From Lat Cla Numerial Integration Stabilit v. hoie of te ie Firt orer v. higher orer metho obot Kinemati obot onfiguration Configuration ae Joint oorinate v. workae oorinate Poition Kinemati otation Tranlation

More information

Geometric Transformations Hearn & Baker Chapter 5. Some slides are taken from Robert Thomsons notes.

Geometric Transformations Hearn & Baker Chapter 5. Some slides are taken from Robert Thomsons notes. Geometric Tranformation Hearn & Baker Chapter 5 Some lie are taken from Robert Thomon note. OVERVIEW Two imenional tranformation Matri repreentation Invere tranformation Three imenional tranformation OpenGL

More information

Dual Arm Robot Research Report

Dual Arm Robot Research Report Dual Arm Robot Research Report Analytical Inverse Kinematics Solution for Moularize Dual-Arm Robot With offset at shouler an wrist Motivation an Abstract Generally, an inustrial manipulator such as PUMA

More information

1/29/13. Computer Graphics. Transformations. Simple Transformations

1/29/13. Computer Graphics. Transformations. Simple Transformations /29/3 Computer Graphics Transformations Simple Transformations /29/3 Contet 3D Coordinate Sstems Right hand (or counterclockwise) coordinate sstem Left hand coordinate sstem Not used in this class and

More information

Computer Organization

Computer Organization Computer Organization Douglas Comer Computer Science Department Purue University 250 N. University Street West Lafayette, IN 47907-2066 http://www.cs.purue.eu/people/comer Copyright 2006. All rights reserve.

More information

CS452/552; EE465/505. Geometry Transformations

CS452/552; EE465/505. Geometry Transformations CS452/552; EE465/505 Geometry Transformations 1-26-15 Outline! Geometry: scalars, points & vectors! Transformations Read: Angel, Chapter 4 (study cube.html/cube.js example) Appendix B: Spaces (vector,

More information

Lecture 3: Geometric Algorithms(Convex sets, Divide & Conquer Algo.)

Lecture 3: Geometric Algorithms(Convex sets, Divide & Conquer Algo.) Advanced Algorithms Fall 2015 Lecture 3: Geometric Algorithms(Convex sets, Divide & Conuer Algo.) Faculty: K.R. Chowdhary : Professor of CS Disclaimer: These notes have not been subjected to the usual

More information

Illumination Model. The governing principles for computing the. Apply the lighting model at a set of points across the entire surface.

Illumination Model. The governing principles for computing the. Apply the lighting model at a set of points across the entire surface. Illumination and Shading Illumination (ighting) Model the interaction of light with surface oints to determine their final color and brightness OenG comutes illumination at vertices illumination Shading

More information