Presentation is loading. Please wait.

Presentation is loading. Please wait.

University of Palestine Computer Graphics ITGD3107 Prepare: Mohammed J. el-masre Nidal M. El-Borbar Supervision:

Similar presentations


Presentation on theme: "University of Palestine Computer Graphics ITGD3107 Prepare: Mohammed J. el-masre Nidal M. El-Borbar Supervision:"— Presentation transcript:

1 p_16_10 @hotmail.com it4ever2008 @hotmail.com1 University of Palestine Computer Graphics ITGD3107 Prepare: Mohammed J. el-masre Nidal M. El-Borbar Supervision: Dr. Sana'a Presentation name : Three Dimensional Viewing

2 p_16_10 @hotmail.com it4ever2008 @hotmail.com2 Contents 3D Viewing Camera Analogy Viewing Pipeline Camera Modeling w/ OpenGL Projections Types of Projections Perspective Projection Parallel Projection Projection Matrix Projection of Lines 3D Viewing with OpenGL Matrix Modes Three Dimensional Viewing

3 p_16_10 @hotmail.com it4ever2008 @hotmail.com3 3D Viewing The steps for computer generation of a view of a three dimensional scene are somewhat analogous to the processes involved in taking a photograph.

4 p_16_10 @hotmail.com it4ever2008 @hotmail.com4 Camera Analogy Position Orientation Window (aperture) of the camera 1. Viewing position 2. Camera orientation 3. Size of clipping window

5 p_16_10 @hotmail.com it4ever2008 @hotmail.com5 Viewing Pipeline The general processing steps for modeling and converting a world coordinate description of a scene to device coordinates:

6 p_16_10 @hotmail.com it4ever2008 @hotmail.com6 Viewing Pipeline 1. Construct the shape of individual objects in a scene within modeling coordinate, and place the objects into appropriate positions within the scene (world coordinate).

7 p_16_10 @hotmail.com it4ever2008 @hotmail.com7 Viewing Pipeline World coordinate positions are converted to viewing coordinates.

8 p_16_10 @hotmail.com it4ever2008 @hotmail.com8 Viewing Pipeline Convert the viewing coordinate description of the scene to coordinate positions on the projection plane.

9 p_16_10 @hotmail.com it4ever2008 @hotmail.com9 Viewing Pipeline Positions on the projection plane, will then mapped to the Normalized coordinate and output device.

10 p_16_10 @hotmail.com it4ever2008 @hotmail.com10 Camera Modeling w/ OpenGL glMatrixMode(GL_MODELVIEW)... glMatrixMode(GL_PROJECTION)... glViewport(0,0,xres,yres) camera coordinate system viewport coordinate system device/screen coordinate system

11 p_16_10 @hotmail.com it4ever2008 @hotmail.com11 Projections Once the view volume is determined, a projection transformation will convert the object in the 3D view volume to a 2D image on the projection plane.

12 p_16_10 @hotmail.com it4ever2008 @hotmail.com12 Types of Projections Perspective Projection Parallel Projection

13 p_16_10 @hotmail.com it4ever2008 @hotmail.com13 Perspective Projection (1/2) Give a realistic view of 3D objects, but does not preserve shape of object or scale Perspective images of parallel lines not parallel with projection plane converge to a point called vanishing point Size of object is diminished with distance Used in architectural, engineering, industrial design, and advertising drawings

14 p_16_10 @hotmail.com it4ever2008 @hotmail.com14 Perspective Projection (2/2) 3-point perspective 1-point perspective 2-point perspective Most popular

15 p_16_10 @hotmail.com it4ever2008 @hotmail.com15 Parallel Projection Accurate and same-scale measurements Not realistic, and may require multiple projections to get a complete feeling of the object Used in drawings of machine parts and in working architectural drawings

16 p_16_10 @hotmail.com it4ever2008 @hotmail.com16 Oblique Parallel Projection (3/3) Isometric cavaliercabinet Multi-view orthographic

17 p_16_10 @hotmail.com it4ever2008 @hotmail.com17 Projection Matrix (1/3) xpypd1xpypd1 xyz1xyz1 = M per/ort. 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1/d 0 M per = 1 0 0 0 0 1 0 0 0 0 0 d 0 0 0 1 M ort = P p (x p,y p,d) = ??? P(x,y,z) d COP z x y

18 p_16_10 @hotmail.com it4ever2008 @hotmail.com18 Projection Matrix (2/3) xpyp01xpyp01 xyz1xyz1 = M per/ort. 1 0 0 0 0 1 0 0 0 0 0 0 1/d 1 M per = 1 0 0 0 0 1 0 0 0 0 0 0 0 1 M ort = P(x,y,z) d P p (x p,y p,0) = ??? COP z x y

19 p_16_10 @hotmail.com it4ever2008 @hotmail.com19 Projection Matrix (3/3) P(x,y,z) d P p (x p,y p,0) = ??? COP z x or y Q (a, b, c) 1 0 –a/c da/c 0 1 –b/c db/c 0 0 –d/Q/c d 2 /Q/c+d 0 0 –1/Q/c d/Q/c+1 M general =

20 p_16_10 @hotmail.com it4ever2008 @hotmail.com20 Projection of Lines d COP z x y Parametric representation of a line that goes through P(p x, p y, p z ) and has direction c = (c x, c y, c z ) l(t) = P+ct where t  (- , +  ) The projected line is x(t) = d(p x +c x t)/(p z +c z t) y(t) = d(p y +c y t)/(p z +c z t) If the original line is parallel to the projection plane (c z = 0) x(t) = d(p x +c x t)/p z, y(t) = d(p y +c y t)/p z, the slope of the projected line is c y /c x, independent of the position of the original line. The projected lines of parallel lines must be parallel

21 p_16_10 @hotmail.com it4ever2008 @hotmail.com21 3D Viewing with OpenGL Viewing transformation: set the position and orientation of the viewpoint Modeling transformation: set the orientation of the model (translate, rotate, scale) Projection transformation: set the view volume and do the projection Viewport transformation: Set the viewport on the computer screen where the scene will be drawn

22 p_16_10 @hotmail.com it4ever2008 @hotmail.com22 Matrix Modes Modelview matrix Set the viewpoint and object location by modifying this matrix glMatrixMode(GL_MODELVIEW) If projection matrix is modified Specify the view volume by modifying this matrix glMatrixMode(GL_PROJECTION) If texture matrix is modified glMatrixMode(GL_TEXTURE)

23 p_16_10 @hotmail.com it4ever2008 @hotmail.com23 References & External links http://en.wikipedia.org/wiki/3dviewing http://anonymouse.org/cgi-bin/anon- www.cgi/http://www.eazyupload.net/download/jtg3c0c6/0135309247.zip.htm http://eazy1.eazyupload.net/download/0ea47c0c7d5c5b872be23f3a8933086 3/0135309247.zip http://dl1.s24.ifile.it/9gtkix4c/prentice_hall_- _computer_graphics_c_version_2ed_-_hearn__baker.pdf Our Book computer_graphics_c_version_2ed


Download ppt "University of Palestine Computer Graphics ITGD3107 Prepare: Mohammed J. el-masre Nidal M. El-Borbar Supervision:"

Similar presentations


Ads by Google