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

Size: px
Start display at page:

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

Transcription

1 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 RB rest of Chap Viewing RB rest of App Homogeneous Coors RB Chap Selection an Feeback RB Sec Object Selection Using the Back Buffer in Chap Now That You Now ) 2 Viewing Using Transformations three was moelling transforms place objects within scene share worl) affine transformations viewing transforms place camera rigi bo transformations: rotate, translate projection transforms change tpe of camera projective transformation 3 4

2 Renering Pipeline Renering Pipeline Scene graph Object geometr Moelling Transforms Scene graph Object geometr Moelling Transforms result all vertices of scene in share 3D worl coorinate sstem Viewing Transform Viewing Transform Projection Transform Projection Transform 5 6 Renering Pipeline Renering Pipeline Scene graph Object geometr Moelling Transforms result scene vertices in 3D view camera) coorinate sstem Scene graph Object geometr Moelling Transforms result 2D screen coorinates of clippe vertices Viewing Transform Viewing Transform Projection Transform Projection Transform 7 8

3 Viewing an Projection Renering Pipeline nee to get from 3D worl to 2D image projection: geometric abstraction what ees or cameras o Geometr Database Moel/View Transform. Lighting Perspective Transform. Clipping two pieces viewing transform: where is the camera, what is it pointing at? perspective transform: 3D to 2D flatten to image Scan Conversion Teturing Depth Test Blening Framebuffer 9 Renering Pipeline OpenGL Transformation Storage Geometr Database Moel/View Transform. Lighting Perspective Transform. Clipping moeling an viewing store together possible because no intervening operations perspective store in separate matri Scan Conversion Teturing Depth Test Blening Framebuffer specif which matri is target of operations common practice: return to efault moelview moe after oing projection operations glmatrimoegl_modelview); glmatrimoegl_projection); 2

4 Coorinate Sstems result of a transformation names convenience animal: leg, hea, tail stanar conventions in graphics pipeline object/moelling worl camera/viewing/ee screen/winow raster/evice 3 Projective Renering Pipeline object worl viewing O2W W2V OCS V2C WCS moeling viewing projection transformation transformation transformation OCS - object/moel coorinate sstem WCS - worl coorinate sstem - viewing/camera/ee coorinate sstem CCS - clipping coorinate sstem NDCS - normalie evice coorinate sstem DCS - evice/ispla/screen coorinate sstem C2N perspective ivie N2D viewport transformation clipping CCS normalie evice NDCS evice DCS 4 Pee Viewing Transformation image plane WCS object worl viewing OCS WCS moeling transformation viewing transformation OCS Basic Viewing starting spot - OpenGL camera at worl origin probabl insie an object ais is up looking own negative ais wh? RHS with horiontal, vertical, out of screen translate backwar so scene is visible move istance = focal length where is camera in P template coe? 5 units back, looking own - ais M mo M cam OpenGL MoelView matri 5 6

5 Convenient Camera Motion rotate/translate/scale versus ee point, gae/lookat irection, up vector emo: Robins transformation, projection OpenGL Viewing Transformation glulookate,e,e,l,l,l,u,u,u) postmultiplies current matri, so to be safe: glmatrimoegl_modelview); glloaientit); glulookate,e,e,l,l,l,u,u,u) // now ok to o moel transformations 7 emo: Nate Robins tutorial projection 8 Convenient Camera Motion Placing Camera in Worl Coors: V2W rotate/translate/scale versus ee point, gae/lookat irection, up vector WCS ee Pee up lookat view Pref 9 treat camera as if it s just an object translate from origin to ee rotate view vector lookat ee) to w ais rotate aroun w to bring up into vw-plane WCS ee w v up Pee u lookat view Pref 2

6 Deriving V2W Transformation translate origin to ee T = e e e Deriving V2W Transformation rotate view vector lookat ee) to w ais w: normalie opposite of view/gae vector g w = ˆ g = g g WCS ee v up lookat view Pref WCS ee v up lookat view Pref w Pee u 2 w Pee u 22 Deriving V2W Transformation Deriving V2W Transformation rotate aroun w to bring up into vw-plane u shoul be perpenicular to vw-plane, thus perpenicular to w an up vector t v shoul be perpenicular to u an w u = t w v = w u t w WCS ee w v up Pee u lookat view Pref 23 rotate from WCS into uvw coorinate sstem with matri that has columns u, v, w u = t w t w e e T = e v = w u w = ˆ g = g g u v w u R = v w u v w M V2W =TR reminer: rotate from uvw to coor ss with matri M that has columns u,v,w 24

7 M V2W =TR V2W vs. W2V e e T = e u v w u R = v w u v w we erive position of camera as object in worl invert for glulookat: go from worl to camera M W2V =M V2W ) - =R - T - u u u e e R = v v v T = w w w e inverse is transpose for orthonormal matrices inverse is negative for translations M W2V =M V2W ) - = R- T - V2W vs. W2V u u u e u u u e u v M = v v e = v v v e v worl2view w w w e w w w e w u u u e u + e u + e u ) v M = v v e v + e v + e v ) W 2V w w w e w + e w + e w ) ) Moving the Camera or the Worl? Worl vs. Camera Coorinates Eample two equivalent operations move camera one wa vs. move worl other wa eample initial OpenGL camera: at origin, looking along - ais create a unit square parallel to camera at = - translate in b 3 possible in two was camera moves to = -3 Note OpenGL moels viewing in left-han coorinates camera stas put, but worl moves to -7 resulting image same either wa possible ifference: are lights specifie in worl or view coorinates? a C2 c b C a =,) W b =,) C = 5,3) W c =,) C2 =,3) C = 5,5) W W 27 28

8 Pinhole Camera Projections I ingreients bo, film, hole punch result picture Pinhole Camera theoretical perfect pinhole light shining through tin hole into ark space iels upsie-own picture Pinhole Camera non-ero sie hole blur: ras hit multiple points on film plane perfect pinhole one ra of projection actual pinhole multiple ras of projection film plane 3 film plane 32

9 Real Cameras Graphics Cameras pinhole camera has small aperture lens opening) minimie blur real pinhole camera: image inverte problem: har to get enough light to epose the film aperture image plane ee point solution: lens permits larger apertures permits changing istance to film plane without actuall moving it cost: limite epth of fiel where image is in focus lens epth of fiel computer graphics camera: convenient equivalent ee point center of projection image plane General Projection image plane nee not be perpenicular to view plane Perspective Projection our camera must moel perspective image plane ee point ee point image plane 35 36

10 Perspective Projection our camera must moel perspective Projective Transformations planar geometric projections planar: onto a plane geometric: using straight lines projections: 3D -> 2D aka projective mappings countereamples? Projective Transformations properties lines mappe to lines an triangles to triangles parallel lines o NOT remain parallel e.g. rails vanishing at infinit Perspective Projection project all geometr through common center of projection ee point) onto an image plane affine combinations are NOT preserve e.g. center of a line oes not map to center of projecte line perspective foreshortening)

11 Perspective Projection Basic Perspective Projection projection plane similar triangles P,, ) P,,) center of projection ee point) how tall shoul this bunn be? = but = nonuniform foreshortening not affine 4 42 Perspective Projection esire result for a point [,,, ] T projecte onto the view plane: =, = = =, = =, = what coul a matri look like to o this? Simple Perspective Projection Matri / / 43 44

12 45 Simple Perspective Projection Matri / / is homogenie version of where w = / / 46 Simple Perspective Projection Matri = / / / is homogenie version of where w = / / 47 Perspective Projection epressible with 44 homogeneous matri use previousl untouche bottom row perspective projection is irreversible man 3D points can be mappe to same,, ) on the projection plane no wa to retrieve the unique values 48 Moving COP to Infinit as COP moves awa, lines approach parallel when COP at infinit, orthographic view

13 Orthographic Camera Projection camera s back plane parallel to lens infinite focal length no perspective convergence just throw awa values p p = p p = p p Perspective to Orthographic transformation of space center of projection moves to infinit view volume transforme from frustum truncate prami) to parallelepipe bo) Frustum - Parallelepipe View Volumes specifies fiel-of-view, use for clipping restricts omain of store for visibilit test perspective view volume =left =top =bottom =-near =right orthographic view volume =left =-far =bottom =top =right =-near =-far Canonical View Volumes stanarie viewing volume representation perspective or front plane or = +/- back plane - front plane orthographic orthogonal parallel or - back plane

14 Wh Canonical View Volumes? permits stanariation clipping easier to etermine if an arbitrar point is enclose in volume with canonical view volume vs. clipping to si arbitrar planes renering projection an rasteriation algorithms can be reuse Normalie Device Coorinates convention viewing frustum mappe to specific parallelepipe Normalie Device Coorinates NDC) same as clipping coors onl objects insie the parallelepipe get renere which parallelepipe? epens on renering sstem Normalie Device Coorinates Unerstaning Z left/right =+/-, top/bottom =+/-, near/far =+/- Camera coorinates NDC right left = Frustum - = - = - = =-n =-f 55 ais flip changes coor sstem haneness RHS before projection ee/view coors) LHS after projection clip, norm evice coors) =left =bottom =top =right =-near =-far NDCS -,-,-),,) 56

15 Unerstaning Z Unerstaning Z near, far alwas positive in OpenGL calls glortholeft,right,bot,top,near,far); glfrustumleft,right,bot,top,near,far); glperspectivefov,aspect,near,far); perspective view volume =left =top =bottom =-near =right =-far orthographic view volume =left =bottom =top =right =-near =-far wh near an far plane? near plane: avoi singularit ivision b ero, or ver small numbers) far plane: store epth in fie-point representation integer), thus have to have fie range of values ) avoi/reuce numerical precision artifacts for istant objects Orthographic Derivation Orthographic Derivation scale, translate, reflect for new coor ss scale, translate, reflect for new coor ss = top = = a + b = bot = NDCS NDCS =left =top =right -,-,-),,) =left =top =right -,-,-),,) =bottom =-near =-far =bottom =-near =-far 59 6

16 Orthographic Derivation scale, translate, reflect for new coor ss = top = = a top + b = a + b = bot = = a bot + b 2 b = a top, b = a bot = top + b top bot a top = a bot 2 top b = ) = a bot a top ) top bot 2 = a bot + top ) top bot ) 2 top b = 2 top bot a = top bot top bot b = top bot 6 Orthographic Derivation scale, translate, reflect for new coor ss = top = = a + b = bot = 2 a = top bot =left =bottom =top =right =-near =-far top + bot b = top bot same iea for right/left, far/near 62 Orthographic Derivation scale, translate, reflect for new coor ss Orthographic Derivation scale, translate, reflect for new coor ss 2 right left P = 2 top bot 2 far near right + left right left top + bot top bot P far + near far near 2 right left P = 2 top bot 2 far near right + left right left top + bot top bot P far + near far near 63 64

17 Orthographic Derivation scale, translate, reflect for new coor ss Orthographic Derivation scale, translate, reflect for new coor ss 2 right left P = 2 top bot 2 far near right + left right left top + bot top bot P far + near far near 2 right left P = 2 top bot 2 far near right + left right left top + bot top bot P far + near far near Orthographic OpenGL glmatrimoegl_projection); glloaientit); glortholeft,right,bot,top,near,far); Demo Brown applets: viewing techniques parallel/orthographic cameras projection cameras catalogs/viewing_techniques.html 67 68

18 Asmmetric Frusta our formulation allows asmmetr wh bother? Projections II right left Frustum - right left Frustum - 69 =-n =-f 7 Asmmetric Frusta our formulation allows asmmetr wh bother? binocular stereo view vector not perpenicular to view plane Right Ee Left Ee Simpler Formulation left, right, bottom, top, near, far nonintuitive often overkill look through winow center smmetric frustum constraints left = -right, bottom = -top 7 72

19 Fiel-of-View Formulation FOV in one irection + aspect ratio w/h) etermines FOV in other irection also set near, far reasonabl intuitive) α Frustum - fov/2 fov/2 w h Perspective OpenGL glmatrimoegl_projection); glloaientit); glfrustumleft,right,bot,top,near,far); or glperspectivefov,aspect,near,far); =-n =-f Demo: Frustum vs. FOV Projective Renering Pipeline Nate Robins tutorial take 2): 75 object worl viewing O2W W2V OCS V2C WCS moeling viewing projection transformation transformation transformation OCS - object/moel coorinate sstem WCS - worl coorinate sstem - viewing/camera/ee coorinate sstem CCS - clipping coorinate sstem NDCS - normalie evice coorinate sstem DCS - evice/ispla/screen coorinate sstem C2N perspective ivie N2D viewport transformation clipping CCS normalie evice NDCS evice DCS 76

20 Projection Warp warp perspective view volume to orthogonal view volume rener all scenes with orthographic projection aka perspective warp Perspective Warp perspective viewing frustum transforme to cube orthographic renering of cube prouces same image as perspective renering of original frustum =α = = = Z Z Preistortion Projective Renering Pipeline 79 object worl viewing O2W W2V OCS V2C WCS moeling viewing projection transformation transformation transformation OCS - object/moel coorinate sstem WCS - worl coorinate sstem - viewing/camera/ee coorinate sstem CCS - clipping coorinate sstem NDCS - normalie evice coorinate sstem DCS - evice/ispla/screen coorinate sstem C2N perspective ivie N2D viewport transformation clipping CCS normalie evice NDCS evice DCS 8

21 8 Separate Warp From Homogeniation warp requires onl stanar matri multipl istort such that orthographic projection of istorte objects is esire persp projection w is change clip after warp, before ivie ivision b w: homogeniation CCS NDCS alter w / w projection transformation viewing normalie evice clipping perspective ivision V2C C2N 82 Perspective Divie Eample specific eample assume image plane at = - a point [,,,] T projects to [-/,-/,-/,] T [,,,-] T - 83 Perspective Divie Eample = ) = * * * * * +, / / / T alter w / w projection transformation perspective ivision after homogeniing, once again w= Perspective Normaliation matri formulation warp an homogeniation both preserve relative epth coorinate) ) * +, -. - = / / / / / ) ) * +, - - = p p p.. / / 2

22 Demo Perspective To NDCS Derivation Brown applets: viewing techniques parallel/orthographic cameras projection cameras catalogs/viewing_techniques.html =top =left =bottom =-near =right =-far NDCS -,-,-),,) Perspective Derivation Perspective Derivation simple eample earlier: = w / earlier: = w / complete: shear, scale, projection-normaliation complete: shear, scale, projection-normaliation E A = F B C D w ) E A = F B C D w ) 87 88

23 Perspective Derivation earlier: = w / complete: shear, scale, projection-normaliation E A = F B C D w ) 89 Recorrection: Perspective Derivation E A F B = C D w = F + B, w = E + A = F + B = C + D w= F + B =, = w = F + B, = F B, = F top near) B, = F top near B L/R sign error = left / w = = right / w = = top / w = = bottom / w = = near / w = = far / w = ais flip F + B F + B, =, w 9 Perspective Derivation similarl for other 5 planes 6 planes, 6 unknowns 2n r + l r l r l 2n t + b t b t b f + n) 2 fn f n f n 9 Projective Renering Pipeline object worl viewing O2W W2V OCS V2C WCS moeling viewing projection transformation transformation transformation OCS - object/moel coorinate sstem WCS - worl coorinate sstem - viewing/camera/ee coorinate sstem CCS - clipping coorinate sstem NDCS - normalie evice coorinate sstem DCS - evice/ispla/screen coorinate sstem C2N perspective ivie N2D viewport transformation clipping CCS normalie evice NDCS evice DCS 92

24 NDC to Device Transformation map from NDC to piel coorinates on ispla NDC range is = -..., = -..., = -... tpical ispla range: =...5, =...3 maimum is sie of actual screen - range ma an efault is, ), use later for visibilit - glviewport,,w,h); gldepthrange,); // epth = b efault NDC 5 3 viewport 93 Origin Location et more possibl confusing) conventions OpenGL origin: lower left most winow sstems origin: upper left then must reflect in when interpreting mouse position, have to flip our coorinates - - NDC 5 3 viewport 94 N2D Transformation general formulation reflect in for upper vs. lower left origin scale b with, height, epth translate b with/2, height/2, epth/2 FCG inclues aitional translation for piel centers at.5,.5) instea of,) - - NDC 5 height 3 with viewport NDC N2D Transformation with D with with 2 2 N + ) D height 2 height N 2 = height N +) N D = epth epth N 2 epth N +) reminer: NDC range is - to Displa range is to. gldepthrangen,f) can constrain further, but epth = is both ma an efault 5 height 3 with viewport 96

25 Device vs. Screen Coorinates viewport/winow location wrt actual ispla not available within OpenGL usuall on t care use relative information when hanling mouse events, not absolute coorinates coul get actual ispla height/with, winow offsets from OS loose use of terms: evice, ispla, winow, screen offset offset ispla viewport viewport height 3 ispla 768 ispla with 97 Projective Renering Pipeline glverte3f,,) object worl viewing O2W OCS WCS W2V V2C alter w glfrustum...) moeling viewing projection transformation transformation transformation clipping gltranslatef,,) glulookat...) C2N / w CCS glrotatefa,,,)... perspective OCS - object coorinate sstem ivision normalie glutinitwinowsiew,h) WCS - worl coorinate sstem N2D evice glviewport,,a,b) NDCS - viewing coorinate sstem viewport transformation CCS - clipping coorinate sstem evice NDCS - normalie evice coorinate sstem DCS DCS - evice coorinate sstem 98 viewing 4-space, W=) projection matri Coorinate Sstems clipping 4-space parallelepipe, with COP move backwars to infinit Perspective Eample tracks in : left =-, =- right =, =- view volume left = -, right = bot = -, top = near =, far = 4 ivie b w normalie evice 3-space parallelepipe) =- = ma- scale translate evice 3-space parallelipipe) =-4 =- real mipoint NDCS DCS ma- framebuffer 99 top view not shown) not shown)

26 Perspective Eample Perspective Eample 2n r + l r l r l 2n t + b t b t b f + n) 2 fn f n f n view volume left = -, right = bot = -, top = near =, far = 4 5/3 8 /3 = 5 /3 8/ 3 / w ND CS = / ND CS = / ND CS = / 3 8 /3 2 OCS2 OpenGL Eample object worl viewing O2W W2V OCS WCS moeling viewing transformation transformation CCS WCS OCS glmatrimoe GL_PROJECTION ); glloaientit); gluperspective 45,.,., 2. ); glmatrimoe GL_MODELVIEW ); glloaientit); gltranslatef.,., -5. ); glpushmatri) gltranslate 4, 4, ); W2O glutsoliteapot); glpopmatri); gltranslate 2, 2, ); W2O glutsoliteapot); V2C projection transformation clipping CCS transformations that are applie to object first are specifie last 3 Reaing for Net Time RB Chap Color FCG Sections FCG Chap 2 Color FCG Chap Visual Perception Color) 4

27 Fl Through The Lens: Roll/Pitch/Yaw Viewing: More Camera Motion 5 6 Viewing: Incremental Relative Motion how to move relative to current camera coorinate sstem? what ou see in the winow computation in coorinate sstem use to raw previous frame is simple: incremental change I to current C at time k, want p = I k I k- I k-2 I k-3... I 5 I 4 I 3 I 2 I Cp each time we just want to premultipl b new matri p =ICp but we know that OpenGL onl supports postmultipl b new matri p =CIp 7 Viewing: Incremental Relative Motion sneak trick: OpenGL moelview matri has the info we want ump out moelview matri from previous frame with glgetdoublev) C = current camera coorinate matri wipe the matri stack with glientit) appl incremental upate matri I appl current camera coor matri C must leave the moelview matri unchange b object transformations after our ispla call use push/pop using OpenGL for storage an calculation quering pipeline is epensive but safe to o just once per frame 8

28 Caution: OpenGL Matri Storage OpenGL internal matri storage is columnwise, not rowwise a e i m b f j n c g k o h l p opposite of stanar C/C++/Java convention possibl confusing if ou look at the matri from glgetdoublev) Viewing: Virtual Trackball interface for spinning objects aroun rag mouse to control rotation of view volume orbit/spin metaphor vs. fling/riving rolling glass trackball center at screen origin, surrouns worl hemisphere sticks up in, out of screen rotate ball = spin worl 9 Clarif: Virtual Trackball know screen click:,, ) want to infer point on trackball:,,) ball is unit sphere, so,, =. solve for ee Clarif: Trackball Rotation user rags between two points on image plane mouse own at i =, ), mouse up at i 2 = a, b) fin corresponing points on virtual ball p =,, ), p 2 = a, b, c) compute rotation angle an ais for ball ais of rotation is plane normal: cross prouct p p 2 amount of rotation θ from angle between lines p p 2 = p p 2 cos θ virtual ball hemisphere i =, ) screen plane i 2 = a, b) image plane,, ) screen plane 2

29 Clarif: Trackball Rotation fining location on ball corresponing to click on image plane ball raius r is screen plane, ) with/2, height/2) virtual ball hemisphere screen plane r=,, ), ) 3 Trackball Computation user efines two points place where first clicke p =,, ) place where release p 2 = a, b, c) create plane from vectors between points, origin ais of rotation is plane normal: cross prouct p - o) p 2 - o): p p 2 if origin =,,) amount of rotation epens on angle between lines p p 2 = p p 2 cos θ p p 2 = p p 2 sin θ compute rotation matri, use to rotate worl 4 Reaing Picking Re Book Selection an Feeback Chapter all Now That You Know Chapter onl Object Selection Using the Back Buffer 5 6

30 Interactive Object Selection move cursor over object, click how to ecie what is below? inverse of renering pipeline flow from piel back up to object ambiguit man 3D worl objects map to same 2D point four common approaches manual ra intersection bouning etents backbuffer color coing selection region with hit list Manual Ra Intersection o all computation at application level map selection point to a ra intersect ra with all objects in scene. avantages no librar epenence isavantages ifficult to program slow: work to o epens on total number an compleit of objects in scene 7 8 Bouning Etents keep track of ais-aligne bouning rectangles avantages conceptuall simple eas to keep track of boes in worl space Bouning Etents isavantages low precision must keep track of object-rectangle relationship etensions o more sophisticate boun bookkeeping first level: bo check. secon level: object check 9 2

31 Backbuffer Color Coing use backbuffer for picking create image as computational entit never isplae to user reraw all objects in backbuffer turn off shaing calculations set unique color for each pickable object store in table rea back piel at cursor location check against table avantages conceptuall simple variable precision isavantages Backbuffer Color Coing introuce 2 reraw ela backbuffer reaback ver slow 2 22 glcolor3f.,.,.); forint i = ; i < 2; i++) forint j = ; j < 2; j++) { glpushmatri); gltranslatefi*3.,,-j * 3.); glcolor3f.,.,.); glcalllistsnowman_ispla_list); glpopmatri); } Backbuffer Eample forint i = ; i < 2; i++) forint j = ; j < 2; j++) { glpushmatri); switch i*2+j) { case : glcolor3ub255,,);break; case : glcolor3ub,255,);break; case 2: glcolor3ub,,255);break; case 3: glcolor3ub25,,25);break; } } gltranslatefi*3.,,-j * 3.) glcalllistsnowman_ispla_list); glpopmatri); Select/Hit use small region aroun cursor for viewport assign per-object integer kes names) reraw in special moe store hit list of objects in region eamine hit list OpenGL support

32 Viewport small rectangle aroun cursor change coor ss so fills viewport wh rectangle instea of point? people aren t great at positioning mouse Fitts Law: time to acquire a target is function of the istance to an sie of the target Viewport nontrivial to compute invert viewport matri, set up new orthogonal projection simple utilit comman glupickmatri,,w,h,viewport),: cursor point w,h: sensitivit/slop in piels) push ol setup first, so can pop it later allow several piels of slop Rener Moes glrenermoemoe) GL_RENDER: normal color buffer efault GL_SELECT: selection moe for picking GL_FEEDBACK: report objects rawn) Name Stack again, names are just integers glinitnames) flat list glloanamename) or hierarch supporte b stack glpushnamename), glpopname can have multiple names per object 27 28

33 Hierarchical Names Eample forint i = ; i < 2; i++) { glpushnamei); forint j = ; j < 2; j++) { glpushmatri); glpushnamej); gltranslatefi*.,,j *.); glpushnamehead); glcalllistsnowmanheadl); glloanamebody); glcalllistsnowmanbodl); glpopname); glpopname); glpopmatri); } glpopname); } 29 Hit List glselectbufferbuffersie, *buffer) where to store hit list ata on hit, cop entire contents of name stack to output buffer. hit recor number of names on stack minimum an maimum epth of object vertices epth lies in the NDC range [,] format: multiplie b 2^32 - then roune to nearest int 3 Integrate vs. Separate Pick Function integrate: use same function to raw an pick simpler to coe name stack commans ignore in rener moe separate: customie functions for each potentiall more efficient can avoi rawing unpickable objects avantages faster Select/Hit OpenGL support means harware acceleration avoi shaing overhea fleible precision sie of region controllable fleible architecture custom coe possible, e.g. guarantee frame rate isavantages more comple 3 32

34 Hbri Picking select/hit approach: fast, coarse object-level granularit manual ra intersection: slow, precise eact intersection point hbri: both spee an precision use select/hit to fin object then intersect ra with that object OpenGL Precision Picking Hints gluunproject transform winow coorinates to object coorinates given current projection an moelview matrices use to create ra into scene from cursor location call gluunproject twice with same,) mouse location = near:,,) = far:,,) subtract near result from far result to get irection vector for ra use this ra for line/polgon intersection Projective Renering Pipeline following pipeline from top/left to glverte3f,,) bottom/right: moving object POV object worl viewing alter w O2W OCS WCS W2V V2C moeling transformation gltranslatef,,) glrotatefa,,,)... OCS - object coorinate sstem glutinitwinowsiew,h) WCS - worl coorinate sstem glviewport,,a,b) - viewing coorinate sstem CCS - clipping coorinate sstem NDCS - normalie evice coorinate sstem DCS - evice coorinate sstem viewing transformation glulookat...) projection transformation C2N / w perspective ivision N2D viewport transformation glfrustum...) clipping CCS normalie evice NDCS evice DCS 35 OCS2 OpenGL Eample go back from en of pipeline to beginning: coor frame POV object worl viewing clipping O2W W2V V2C OCS WCS CCS CCS WCS OCS moeling transformation viewing transformation glmatrimoe GL_PROJECTION ); glloaientit); gluperspective 45,.,., 2. ); glmatrimoe GL_MODELVIEW ); glloaientit); gltranslatef.,., -5. ); glpushmatri) gltranslate 4, 4, ); W2O glutsoliteapot); glpopmatri); gltranslate 2, 2, ); W2O glutsoliteapot); projection transformation V2W transformations that are applie to object first are specifie last 36

35 Coor Ss: Frame vs Point rea own: transforming between coorinate frames, from frame A to frame B OpenGL comman orer DCS D2N NDCS N2V V2W W2O WCS OCS rea up: transforming points, up from frame B coors to frame A coors ispla glviewport,,a,b) glfrustum...) normalie evice viewing glulookat...) worl glrotatefa,,,) object glverte3f,,) N2D V2N W2V O2W 37 pipeline interpretation Coor Ss: Frame vs Point is glulookat viewing transformation V2W or W2V? epens on which wa ou rea coorinate frames: V2W takes ou from view to worl coorinate frame points/objects: W2V point is transforme from worl to view coors when multipl b glulookat matri H2 uses the object/pipeline POV Q/4 is W2V glulookat) Q2/5-6 is V2N glfrustum) Q3/7 is N2D glviewport) 38

Viewing/Projection IV. Week 4, Fri Jan 29

Viewing/Projection IV. Week 4, Fri Jan 29 Universit of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munner Viewing/Projection IV Week 4, Fri Jan 29 http://www.ugrad.cs.ubc.ca/~cs314/vjan2010 News etra TA office hours in lab

More information

Viewing/Projections III. Week 4, Wed Jan 31

Viewing/Projections III. Week 4, Wed Jan 31 Universit of British Columbia CPSC 34 Computer Graphics Jan-Apr 27 Tamara Munner Viewing/Projections III Week 4, Wed Jan 3 http://www.ugrad.cs.ubc.ca/~cs34/vjan27 News etra TA coverage in lab to answer

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

Viewing/Projections IV. Week 4, Fri Feb 1

Viewing/Projections IV. Week 4, Fri Feb 1 Universit of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Viewing/Projections IV Week 4, Fri Feb 1 http://www.ugrad.cs.ubc.ca/~cs314/vjan2008 News extra TA office hours in lab

More information

Viewing and Projection

Viewing and Projection Viewing and Projection Sheelagh Carpendale Camera metaphor. choose camera position 2. set up and organie objects 3. choose a lens 4. take the picture View Volumes what gets into the scene perspective view

More information

University of British Columbia CPSC 314 Computer Graphics Jan-Apr Tamara Munzner. Viewing 4. Page 1

University of British Columbia CPSC 314 Computer Graphics Jan-Apr Tamara Munzner. Viewing 4. Page 1 University of British Columbia CPSC 34 Computer Graphics Jan-Apr 206 Tamara Munzner Viewing 4 http://www.ugrad.cs.ubc.ca/~cs34/vjan206 Page 2 Projective Rendering Pipeline object world viewing O2W OCS

More information

University of British Columbia CPSC 314 Computer Graphics Jan-Apr Tamara Munzner. Viewing 4.

University of British Columbia CPSC 314 Computer Graphics Jan-Apr Tamara Munzner. Viewing 4. University of British Columbia CPSC 34 Computer Graphics Jan-Apr 206 Tamara Munzner Viewing 4 http://www.ugrad.cs.ubc.ca/~cs34/vjan206 Projective Rendering Pipeline object world viewing O2W OCS WCS W2V

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 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

Transformations III. Week 2, Fri Jan 19

Transformations III. Week 2, Fri Jan 19 Universit of British Columbia CPSC 34 Computer Graphics Jan-Apr 2007 Tamara Munzner Transformations III Week 2, Fri Jan 9 http://www.ugrad.cs.ubc.ca/~cs34/vjan2007 Readings for Jan 5-22 FCG Chap 6 Transformation

More information

Transformations II. Week 2, Wed Jan 17

Transformations II. Week 2, Wed Jan 17 Universit of British Columbia CPSC 34 Computer Graphics Jan-Apr 27 Tamara Munzner Transformations II Week 2, Wed Jan 7 http://www.ugrad.cs.ubc.ca/~cs34/vjan27 Readings for Jan 5-22 FCG Chap 6 Transformation

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

To Do. Demo (Projection Tutorial) Motivation. What we ve seen so far. Outline. Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 5: Viewing

To Do. Demo (Projection Tutorial) Motivation. What we ve seen so far. Outline. Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 5: Viewing Foundations of Computer Graphics (Fall 0) CS 84, Lecture 5: Viewing http://inst.eecs.berkele.edu/~cs84 To Do Questions/concerns about assignment? Remember it is due Sep. Ask me or TAs re problems Motivation

More information

Motivation. What we ve seen so far. Demo (Projection Tutorial) Outline. Projections. Foundations of Computer Graphics

Motivation. What we ve seen so far. Demo (Projection Tutorial) Outline. Projections. Foundations of Computer Graphics Foundations of Computer Graphics Online Lecture 5: Viewing Orthographic Projection Ravi Ramamoorthi Motivation We have seen transforms (between coord sstems) But all that is in 3D We still need to make

More information

To Do. Motivation. Demo (Projection Tutorial) What we ve seen so far. Computer Graphics. Summary: The Whole Viewing Pipeline

To Do. Motivation. Demo (Projection Tutorial) What we ve seen so far. Computer Graphics. Summary: The Whole Viewing Pipeline Computer Graphics CSE 67 [Win 9], Lecture 5: Viewing Ravi Ramamoorthi http://viscomp.ucsd.edu/classes/cse67/wi9 To Do Questions/concerns about assignment? Remember it is due tomorrow! (Jan 6). Ask me or

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

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

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

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

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

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

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

Procedural Approaches II, Picking. Week 10, Wed Mar 21

Procedural Approaches II, Picking. Week 10, Wed Mar 21 University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Procedural Approaches II, Picking Week 10, Wed Mar 21 http://www.ugrad.cs.ubc.ca/~cs314/vjan2007 News showing up for

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

CPSC 314, Midterm Exam. 8 March 2010

CPSC 314, Midterm Exam. 8 March 2010 CPSC, Midterm Eam 8 March 00 Closed book, no electronic devices besides (simple, nongraphing) calculators. Cell phones must be turned off. Place our photo ID face up on our desk. One single-sided sheet

More information

CS 4731/543: Computer Graphics Lecture 5 (Part I): Projection. Emmanuel Agu

CS 4731/543: Computer Graphics Lecture 5 (Part I): Projection. Emmanuel Agu CS 4731/543: Computer Graphics Lecture 5 (Part I): Projection Emmanuel Agu 3D Viewing and View Volume Recall: 3D viewing set up Projection Transformation View volume can have different shapes (different

More information

Projection: Mapping 3-D to 2-D. Orthographic Projection. The Canonical Camera Configuration. Perspective Projection

Projection: Mapping 3-D to 2-D. Orthographic Projection. The Canonical Camera Configuration. Perspective Projection Projection: Mapping 3-D to 2-D Our scene models are in 3-D space and images are 2-D so we need some wa of projecting 3-D to 2-D The fundamental approach: planar projection first, we define a plane in 3-D

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

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

CS 428: Fall Introduction to. Viewing and projective transformations. Andrew Nealen, Rutgers, /23/2009 1

CS 428: Fall Introduction to. Viewing and projective transformations. Andrew Nealen, Rutgers, /23/2009 1 CS 428: Fall 29 Introduction to Computer Graphics Viewing and projective transformations Andrew Nealen, Rutgers, 29 9/23/29 Modeling and viewing transformations Canonical viewing volume Viewport transformation

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 Graphics Bing-Yu Chen National Taiwan Universit The Universit of Toko Viewing in 3D 3D Viewing Process Classical Viewing and Projections 3D Snthetic Camera Model Parallel Projection Perspective

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

Viewing and Projection Transformations

Viewing and Projection Transformations Viewing and Projection Transformations Projective Rendering Pipeline OCS WCS VCS modeling transformation viewing transformation OCS - object coordinate system WCS - world coordinate system VCS - viewing

More information

CPSC 314, Midterm Exam. 8 March 2013

CPSC 314, Midterm Exam. 8 March 2013 CPSC, Midterm Eam 8 March 0 Closed book, no electronic devices besides simple calculators. Cell phones must be turned off. Place our photo ID face up on our desk. One single-sided sheet of handwritten

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

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

MAN-522: COMPUTER VISION SET-2 Projections and Camera Calibration

MAN-522: COMPUTER VISION SET-2 Projections and Camera Calibration MAN-522: COMPUTER VISION SET-2 Projections and Camera Calibration Image formation How are objects in the world captured in an image? Phsical parameters of image formation Geometric Tpe of projection Camera

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

Notes. University of British Columbia

Notes. University of British Columbia Notes Drop-bo is no. 14 You can hand in our assignments Assignment 0 due Fri. 4pm Assignment 1 is out Office hours toda 16:00 17:00, in lab or in reading room Uniersit of Uniersit of Chapter 4 - Reminder

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

CPSC 314, Midterm Exam 1. 9 Feb 2007

CPSC 314, Midterm Exam 1. 9 Feb 2007 CPSC, Midterm Eam 9 Feb 007 Closed book, no calculators or other electronic devices. Cell phones must be turned off. Place our photo ID face up on our desk. One single-sided sheet of handwritten notes

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

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

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CSE528 Computer Graphics: Theory, Algorithms, and Applications CSE528 Computer Graphics: Theor, Algorithms, and Applications Hong Qin State Universit of New York at Ston Brook (Ston Brook Universit) Ston Brook, New York 794--44 Tel: (63)632-845; Fa: (63)632-8334 qin@cs.sunsb.edu

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

Projections. Brian Curless CSE 457 Spring Reading. Shrinking the pinhole. The pinhole camera. Required:

Projections. Brian Curless CSE 457 Spring Reading. Shrinking the pinhole. The pinhole camera. Required: Reading Required: Projections Brian Curless CSE 457 Spring 2013 Angel, 5.1-5.6 Further reading: Fole, et al, Chapter 5.6 and Chapter 6 David F. Rogers and J. Alan Adams, Mathematical Elements for Computer

More information

3D Viewing. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

3D Viewing. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller 3D Viewing CMPT 361 Introduction to Computer Graphics Torsten Möller Reading Chapter 4 of Angel Chapter 6 of Foley, van Dam, 2 Objectives What kind of camera we use? (pinhole) What projections make sense

More information

Models and The Viewing Pipeline. Jian Huang CS456

Models and The Viewing Pipeline. Jian Huang CS456 Models and The Viewing Pipeline Jian Huang CS456 Vertex coordinates list, polygon table and (maybe) edge table Auxiliary: Per vertex normal Neighborhood information, arranged with regard to vertices and

More information

University of British Columbia CPSC 314 Computer Graphics May-June Tamara Munzner. Rasterization, Interpolation, Vision/Color

University of British Columbia CPSC 314 Computer Graphics May-June Tamara Munzner. Rasterization, Interpolation, Vision/Color University of British Columbia CPSC 34 Computer Graphics May-June 5 Tamara Munzner Rasterization, Interpolation, Vision/Color Week, Thu May 9 http://www.ugra.cs.ubc.ca/~cs34/vmay5 News reminer: extra lab

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

3D Geometry and Camera Calibration

3D Geometry and Camera Calibration 3D Geometr and Camera Calibration 3D Coordinate Sstems Right-handed vs. left-handed 2D Coordinate Sstems ais up vs. ais down Origin at center vs. corner Will often write (u, v) for image coordinates v

More information

Chap 7, 2008 Spring Yeong Gil Shin

Chap 7, 2008 Spring Yeong Gil Shin Three-Dimensional i Viewingi Chap 7, 28 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 synthetic camera)

More information

Prof. Feng Liu. Fall /19/2016

Prof. Feng Liu. Fall /19/2016 Prof. Feng Liu Fall 26 http://www.cs.pdx.edu/~fliu/courses/cs447/ /9/26 Last time More 2D Transformations Homogeneous Coordinates 3D Transformations The Viewing Pipeline 2 Today Perspective projection

More information

CS 475 / CS 675 Computer Graphics. Lecture 7 : The Modeling-Viewing Pipeline

CS 475 / CS 675 Computer Graphics. Lecture 7 : The Modeling-Viewing Pipeline CS 475 / CS 675 Computer Graphics Lecture 7 : The Modeling-Viewing Pipeline Taonom Planar Projections Parallel Perspectie Orthographic Aonometric Oblique Front Top Side Trimetric Dimetric Isometric Caalier

More information

CS 543: Computer Graphics. Projection

CS 543: Computer Graphics. Projection CS 543: Computer Graphics Projection Robert W. Lindeman Associate Professor Interactive Media & Game Development Department of Computer Science Worcester Poltechnic Institute gogo@wpi.edu with lots of

More information

3-Dimensional Viewing

3-Dimensional Viewing CHAPTER 6 3-Dimensional Vieing Vieing and projection Objects in orld coordinates are projected on to the vie plane, hich is defined perpendicular to the vieing direction along the v -ais. The to main tpes

More information

3D Viewing. Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

3D Viewing. Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller 3D Viewing Introduction to Computer Graphics Torsten Möller Machiraju/Zhang/Möller Reading Chapter 4 of Angel Chapter 13 of Hughes, van Dam, Chapter 7 of Shirley+Marschner Machiraju/Zhang/Möller 2 Objectives

More information

Chap 3 Viewing Pipeline Reading: Angel s Interactive Computer Graphics, Sixth ed. Sections 4.1~4.7

Chap 3 Viewing Pipeline Reading: Angel s Interactive Computer Graphics, Sixth ed. Sections 4.1~4.7 Chap 3 Viewing Pipeline Reading: Angel s Interactive Computer Graphics, Sixth ed. Sections 4.~4.7 Chap 3 View Pipeline, Comp. Graphics (U) CGGM Lab., CS Dept., NCTU Jung Hong Chuang Outline View parameters

More information

Geometry: Outline. Projections. Orthographic Perspective

Geometry: Outline. Projections. Orthographic Perspective Geometry: Cameras Outline Setting up the camera Projections Orthographic Perspective 1 Controlling the camera Default OpenGL camera: At (0, 0, 0) T in world coordinates looking in Z direction with up vector

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

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

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

3D Viewing and Projec5on. Taking Pictures with a Real Camera. Steps: Graphics does the same thing for rendering an image for 3D geometric objects

3D Viewing and Projec5on. Taking Pictures with a Real Camera. Steps: Graphics does the same thing for rendering an image for 3D geometric objects 3D Vieing and Projec5on Taking Pictures ith a Real Camera Steps: Iden5 interes5ng objects Rotate and translate the camera to desired viepoint Adjust camera seings such as ocal length Choose desired resolu5on

More information

p =(x,y,d) y (0,0) d z Projection plane, z=d

p =(x,y,d) y (0,0) d z Projection plane, z=d Projections ffl Mapping from d dimensional space to d 1 dimensional subspace ffl Range of an projection P : R! R called a projection plane ffl P maps lines to points ffl The image of an point p under P

More information

Perspective Projection Transformation

Perspective Projection Transformation Perspective Projection Transformation Where does a point of a scene appear in an image?? p p Transformation in 3 steps:. scene coordinates => camera coordinates. projection of camera coordinates into image

More information

Computer Graphics. Chapter 10 Three-Dimensional Viewing

Computer Graphics. Chapter 10 Three-Dimensional Viewing Computer Graphics Chapter 10 Three-Dimensional Viewing Chapter 10 Three-Dimensional Viewing Part I. Overview of 3D Viewing Concept 3D Viewing Pipeline vs. OpenGL Pipeline 3D Viewing-Coordinate Parameters

More information

Game Architecture. 2/19/16: Rasterization

Game Architecture. 2/19/16: Rasterization Game Architecture 2/19/16: Rasterization Viewing To render a scene, need to know Where am I and What am I looking at The view transform is the matrix that does this Maps a standard view space into world

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

CS 351: Perspective Viewing

CS 351: Perspective Viewing CS 351: Perspective Viewing Instructor: Joel Castellanos e-mail: joel@unm.edu Web: http://cs.unm.edu/~joel/ 2/16/2017 Perspective Projection 2 1 Frustum In computer graphics, the viewing frustum is the

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

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CSE528 Computer Graphics: Theory, Algorithms, and Applications CSE528 Computer Graphics: Theory, Algorithms, and Applications Hong Qin Stony Brook University (SUNY at Stony Brook) Stony Brook, New York 11794-2424 Tel: (631)632-845; Fax: (631)632-8334 qin@cs.stonybrook.edu

More information

Today. The Graphics Pipeline: Projective Transformations. Last Week: Schedule. XForms Forms Library. Questions?

Today. The Graphics Pipeline: Projective Transformations. Last Week: Schedule. XForms Forms Library. Questions? Toda The Graphics Pipeline: Projectie Reiew & Schedule Ra Casting / Tracing s. The Graphics Pipeline Projectie Last Week: Animation & Quaternions Finite Element Simulations collisions, fracture, & deformation

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

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline Computergrafik Today Rendering pipeline s View volumes, clipping Viewport Matthias Zwicker Universität Bern Herbst 2008 Rendering pipeline Rendering pipeline Hardware & software that draws 3D scenes on

More information

6. Modelview Transformations

6. Modelview Transformations 6. Modelview Transformations Transformation Basics Transformations map coordinates from one frame of reference to another through matri multiplications Basic transformation operations include: - translation

More information

COMP Computer Graphics and Image Processing. a6: Projections. In part 2 of our study of Viewing, we ll look at. COMP27112 Toby Howard

COMP Computer Graphics and Image Processing. a6: Projections. In part 2 of our study of Viewing, we ll look at. COMP27112 Toby Howard Computer Graphics and Image Processing a6: Projections Tob.Howard@manchester.ac.uk Introduction In part 2 of our stud of Viewing, we ll look at The theor of geometrical planar projections Classes of projections

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

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

Viewing Transformation

Viewing Transformation Viewing and Projection Transformations Projective Rendering Pipeline OCS WCS VCS modeling transformation Mm.odd viewing transformation Mview OCS - object coordinate system WCS - world coordinate system

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

Message Transport With The User Datagram Protocol

Message Transport With The User Datagram Protocol Message Transport With The User Datagram Protocol User Datagram Protocol (UDP) Use During startup For VoIP an some vieo applications Accounts for less than 10% of Internet traffic Blocke by some ISPs Computer

More information

CSCI-4530/6530 Advanced Computer Graphics

CSCI-4530/6530 Advanced Computer Graphics Luo Jr. CSCI-45/65 Advanced Computer Graphics http://www.cs.rpi.edu/~cutler/classes/advancedgraphics/s9/ Barb Cutler cutler@cs.rpi.edu MRC 9A Piar Animation Studios, 986 Topics for the Semester Mesh Simplification

More information

Evening s Goals. Mathematical Transformations. Discuss the mathematical transformations that are utilized for computer graphics

Evening s Goals. Mathematical Transformations. Discuss the mathematical transformations that are utilized for computer graphics Evening s Goals Discuss the mathematical transformations that are utilized for computer graphics projection viewing modeling Describe aspect ratio and its importance Provide a motivation for homogenous

More information

Warping, Morphing and Mosaics

Warping, Morphing and Mosaics Computational Photograph and Video: Warping, Morphing and Mosaics Prof. Marc Pollefes Dr. Gabriel Brostow Toda s schedule Last week s recap Warping Morphing Mosaics Toda s schedule Last week s recap Warping

More information

One or more objects A viewer with a projection surface Projectors that go from the object(s) to the projection surface

One or more objects A viewer with a projection surface Projectors that go from the object(s) to the projection surface Classical Viewing Viewing requires three basic elements One or more objects A viewer with a projection surface Projectors that go from the object(s) to the projection surface Classical views are based

More information

CSE328 Fundamentals of Computer Graphics

CSE328 Fundamentals of Computer Graphics CSE328 Fundamentals of Computer Graphics Hong Qin State University of New York at Stony Brook (Stony Brook University) Stony Brook, New York 794--44 Tel: (63)632-845; Fax: (63)632-8334 qin@cs.sunysb.edu

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

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

Scene Graphs & Modeling Transformations COS 426

Scene Graphs & Modeling Transformations COS 426 Scene Graphs & Modeling Transformations COS 426 3D Object Representations Points Range image Point cloud Surfaces Polgonal mesh Subdivision Parametric Implicit Solids Voels BSP tree CSG Sweep High-level

More information

Lecture 5: Transforms II. Computer Graphics and Imaging UC Berkeley CS184/284A

Lecture 5: Transforms II. Computer Graphics and Imaging UC Berkeley CS184/284A Lecture 5: Transforms II Computer Graphics and Imaging UC Berkeley 3D Transforms 3D Transformations Use homogeneous coordinates again: 3D point = (x, y, z, 1) T 3D vector = (x, y, z, 0) T Use 4 4 matrices

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

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

Viewing. Cliff Lindsay, Ph.D. WPI

Viewing. Cliff Lindsay, Ph.D. WPI Viewing Cliff Lindsa, Ph.D. WPI Building Virtual Camera Pipeline l Used To View Virtual Scene l First Half of Rendering Pipeline Related To Camera l Takes Geometr From ApplicaHon To RasteriaHon Stages

More information

Perspective transformations

Perspective transformations Perspective transformations Transformation pipeline Modelview: model (position objects) + view (position the camera) Projection: map viewing volume to a standard cube Perspective division: project D to

More information

Classical and Computer Viewing. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico

Classical and Computer Viewing. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico Classical and Computer Viewing Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico Planar Geometric Projections Standard projections project onto a plane Projectors

More information

Lecture 4. Viewing, Projection and Viewport Transformations

Lecture 4. Viewing, Projection and Viewport Transformations Notes on Assignment Notes on Assignment Hw2 is dependent on hw1 so hw1 and hw2 will be graded together i.e. You have time to finish both by next monday 11:59p Email list issues - please cc: elif@cs.nyu.edu

More information

The 3-D Graphics Rendering Pipeline

The 3-D Graphics Rendering Pipeline The 3-D Graphics Rendering Pipeline Modeling Trival Rejection Illumination Viewing Clipping Projection Almost ever discussion of 3-D graphics begins here Seldom are an two versions drawn the same wa Seldom

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

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

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