1 / 11

Viewing in 3D

Viewing in 3D. Conceptual model of the 3D viewing process. 2D device coordinates. 3D world-coordinate output primitives. Clipped world coordinates. Clip against view volume. Project onto projection plane. Transform into viewport in 2D device coordinates for display. 3D Coordinate Systems.

Download Presentation

Viewing in 3D

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Viewing in 3D Conceptual model of the 3D viewing process 2D device coordinates 3D world-coordinate output primitives Clipped world coordinates Clip against view volume Project onto projection plane Transform into viewport in 2D device coordinates for display 240-422 Computer Graphics : Viewing in 3D

  2. 3D Coordinate Systems y axis y axis z axis -1 +1 x axis x axis +1 -1 z axis Right-handed (for mathematics) Left-handed (for computer graphics) 240-422 Computer Graphics : Viewing in 3D

  3. 3D Primitives: Point & Line • Any point in 3D coordinate is defined by (x,y,z) • Any line in 3D coordinate is defined with 2 points: (x1, y1, z1) and (x2, y2, z2) • Line equations: or 240-422 Computer Graphics : Viewing in 3D

  4. 3D Primitives: Planes • A plane is specified as Ax + By + Cz + D = 0 (A, B, C, D are constants) or x + B1y + C1z + D1 = 0 (where B1 = B/A, C1 = C/A and D1 = D/A) • If we know 3 points (not all in a line), we can determine the plain equation from x1 + B1y1 + C1z1 + D1 = 0 x2 + B1y2 + C1z2 + D1 = 0 x3 + B1y3 + C1z3 + D1 = 0 Solving for B1, C1, D1 yields the plain equation 240-422 Computer Graphics : Viewing in 3D

  5. 3D Primitives: Planes (cont’d) • A plane can also be specified with a single point in the plane (xp, yp, zp) and the normal vector (direction perpendicular to the plane) [Nx, Ny, Nz] [Nx, Ny, Nz] (xp, yp, zp) Plane equation: Nx(x-xp) + Ny(y-yp) +Nz(z-zp) = 0 240-422 Computer Graphics : Viewing in 3D

  6. Geometrical Projections Parallel: determined by Direction of Projection (DOP) (projectors are parallel—do not converge to an “eye” or COP) Perspective: determined by Center of Projection (COP) (in our diagrams the “eye”) 240-422 Computer Graphics : Viewing in 3D

  7. Parallel Projection • Suppose the direction of projection is given by the vector [xp, yp, zp] and the image is to be projected onto the xy plane • If we have a point on the object at (x1, y1, z1), we wish to determine where the projected point (x2, y2) will lie. • Writing the equations for a line passing the point (x,y,z) and in the direction of projection: x = x1 + xpu y = y1 + ypu z = z1 + zpu 240-422 Computer Graphics : Viewing in 3D

  8. Parallel Projection • Where does this line intersect the xy plane (z=0)? Since u = -z1/zp substituting this into the first two equations gives x2 = x1 - z1 (xp/zp) y2 = y1 - z1 (yp/zp) This can be written in matrix form 240-422 Computer Graphics : Viewing in 3D

  9. Perspective Projection • The further an object is from the viewer, the smaller it appears • If the center of projection is at (xc, yc, zc) and the point on the object is (x1, y1, z1) then the project ray will be the line containing these points and will be given by x = xc + (x1-xc)u y = yc + (y1-yc)u z = zc + (z1-zc)u 240-422 Computer Graphics : Viewing in 3D

  10. Perspective Projection • The projected point (x2, y2) will be the point where this line intersects the xy plane • For this intersection point (z=0), we can compute u u = -zc / (z1-zc) • Substituting into the first two equations gives or 240-422 Computer Graphics : Viewing in 3D

  11. Perspective Projection • In matrix form 240-422 Computer Graphics : Viewing in 3D

More Related