Trang 4 Viewing transformation■ More logical to use dimensions which are appropriate to the object.. □metres for buildings, □millimetres for assembly parts, □nanometres or microns for mo
Lesson Viewing Transformation Trinh Thanh Trung School of ICT, HUST Content Overview 2D viewing transformation 3D viewing transformation Overview Viewing transformation ■ More logical to use dimensions which are appropriate to the object e.g □ metres for buildings, □ millimetres for assembly parts, □ nanometres or microns for molecules, cells, and atoms ■ Objects are described with respect to their actual physical size in the real world, ■ These measurements are then mapped onto screen co-ordinates before displaying Viewing transformation ■ Apply transform to convert from Modelling co- ordinates to Screen Coordinates ■ We can scale dimensions to change the resulting view ■ We can even achieve a zooming in and out effect without changing the model by scaling dimensions proportionally Problems ■ How much of the model should be drawn? ■ Where should it appear on the display? ■ How we convert Real-world co-ordinates into screen co-ordinates? Viewing transformation ■ Transform into camera coordinates ■ Perform projection into screen coordinate or view volume ■ Clip geometry outside the view volume ■ Homogeneous transformation v=Mproj Mc←w Mw←l vl Homogeneous Coordinates ■ In homogenous coordinates, (x,y,z,w) represent the same point when all elements are multiplied by the same factor □ (2,0,1,1) and (4,0,2,2) are the same points □ To bring back to Cartesian space, need to divide the other elements by the fourth element w ▫ (x, y, z, w) → (x/w, y/w, z/w, 1) 2D viewing transformation Window and viewport ■ Window: the portion of the world which will be displayed ■ Viewport: The screen where the image will be displayed (wxmax,wymax) (vxmax,vymax) (wx,wy) (vx,vy) (wxmin,wymin) (vxmin,vymin)