Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 325 Introduction to Computer Graphics 02 / 22 / 2010 Instructor: Michael Eckmann.

Similar presentations


Presentation on theme: "CS 325 Introduction to Computer Graphics 02 / 22 / 2010 Instructor: Michael Eckmann."— Presentation transcript:

1 CS 325 Introduction to Computer Graphics 02 / 22 / 2010 Instructor: Michael Eckmann

2 Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Today’s Topics Questions/comments? 3d transforms –fixed point scaling Projections –parallel and perspective projections

3 Michael Eckmann - Skidmore College - CS 325 - Spring 2010 3d Scale w/ fixed point First transform the fixed point to the origin with a translation matrix. Then do the 3d Scale [ s x 0 0 0 ] [ 0 s y 0 0 ] [ 0 0 s z 0 ] [ 0 0 0 1 ] Then transform the origin back to the fixed point via the inverse of the first translation matrix.

4 Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Rigid body vs. Affine Transformations that preserve line lengths and angles do not deform shapes. Therefore they are called rigid body transformations. –Translation and Rotation (and any combination of these) are examples of rigid body transformations. Transformations that preserve parallel lines, that is, lines that were parallel before the transform remain parallel after the transform are called affine transformations. –Line lengths and angles need not be preserved for a transformation to be considered affine –Rotation, Translation, Scale and Shear (and any combination of these) are examples of affine transformations.

5 Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Projection terminology Projection –transformation of points in a coordinate system of dimension n to a coordinate system of dimension less than n (from Foley, VanDam, Feiner, Hughes)‏ Planar Geometric Projections –planar means we're projecting onto a plane (2d) --- this plane is called the projection plane (also sometimes the view plane)‏ –geometric means we're using straight (not curved) projectors (projectors are the blue dotted lines on the slide after the next.)‏ –Many projections in cartography are non planar or non geometric. When we use the word projection from here on out, we're talking about Planar Geometric Projection.

6 Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Projection types Breakdown of Planar Geometric Projections: –Parallel orthographic –top –front –side –axonometric isometric other oblique –cabinet –cavalier –other –Perspective one point two point three point

7 Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Projection types There are many subclasses of projections Projections can be either parallel or perspective. The distance between the center of projection (CoP) (= convergence point in the diagram) and the projection plane is infinity for parallel projections and is finite for perspective projections.

8 Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Projection types Perspective projections can be 1 point, 2 point or 3 point. Diagrams below show 1 point and 2 point. 3 point perspective would occur if in the 2 point perspective diagram, the vertical lines instead of being parallel, vanished to some point (above or below). The word point here refers to a principle vanishing point.

9 Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Projection types The 1 point perspective projection is made when one of the coordinate axes is cut by the projection plane. 2 point is when 2 coordinate axes are cut by the projection plane. And 3 point when all 3 coordinate axes are cut by the projection plane. So, in other words, the 1, 2 and 3 point projections are generated by situating the view plane such that it intersects with either 1, 2 or 3 principle axes (x, y and/or z), respectively. If we have a 1 point perspective projection and the view plane intersects with the x axis, what can we say about the relation between the view plane and the y-z plane?

10 Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Perspective Projection Parallel lines in the world appear parallel in the projection (view plane) if they are parallel to the view plane (e.g. see vertical lines in the figure b) and c) a few slides ago.)‏ Any lines that are parallel to each other in the world, but are not parallel to the view plane will converge to a vanishing point. There are an infinity of vanishing points, because there are an infinity of line directions. There is 1 center of projection for any perspective projection.

11 Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Projection types Parallel projections can be orthographic or oblique. Orthographic (aka orthogonal) are those that have the projectors perpendicular (normal) to the view plane. Oblique are those that have the projectors not normal to the view plane.

12 Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Projection types Orthographic projections can be further divided into top (aka plan), front elevation, side elevation or axonometric. The top, front and side elevation projections are typically used in drafting (Engineering or Architectural drawings.) Think of a view of a building where the projectors are parallel to each other and perpendicular to the view plane and the view plane is either parallel to the top, front or side of a building, and hence only one face of the building will displayed in the view plane. Axonometric projections are orthographic and have the view plane situated so that it is not orthogonal to a principle axis. Isometric projection is the kind of axonometric projection where three faces are displayed on the view plane and the view plane cuts the 3 coordinate axes at equal distances from the origin.

13 Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Projection types Oblique parallel projections are those that have their projectors not normal to the view plane. Two common kinds of oblique projections are cavalier and cabinet. Cavalier are those whose projector angle is 45 degrees with the projection plane. Cabinet are those whose projector angle is about 63.4 degrees (tan -1 2) with the projection plane. These appear more realistic than cavalier, because lines that are perpendicular to the viewing plane are projected at half length.

14 Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Projection types Recap on the breakdown of Planar Geometric Projections: –Parallel (CoP at infinity)‏ orthographic (projectors normal to the view plane)‏ –top (view plane parallel to x-z plane)‏ –front –side –axonometric (see more than one face in the view plane)‏ isometric (see three faces in view plane and view plane intersects the 3 coordinate axes at the same distance from the origin.)‏ other oblique (projectors not normal to the view plane)‏ –cabinet (projector angle is 63.4 degrees)‏ –cavalier (projector angle is about 45 degrees)‏ –other –Perspective (CoP is finite)‏ one point (vanishing point only in one principle direction)‏ two point (vanishing points in two principle directions)‏ three point (vanishing points in three principle directions)‏

15 Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Perspective Matrix Derivation Now we'll derive the matrix for a one point perspective projection onto a viewing plane that intersects the z axis. Assume that the viewing plane is at z=0 Assume that the center of projection is at (0, 0, -d)‏ Given a point in 3 space, what is its projected coordinates on the plane at z=0? Let's draw a diagram on the board.

16 Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Perspective Matrix Derivation Using the parametric equation of a line, the line will go through CoP = (0, 0, -d) and through the point in space that we are projecting P = (x,y,z). The projected point P proj = (x proj, y proj, z proj ), lies on the z=0 plane. x proj = x + t(0-x) = x – tx y proj = y + t(0-y) = y – ty z proj = z + t(-d-z) = z – t ( d+ z) = 0, so t=z/(d+z)‏ substitute t into the x proj and y proj equations to get: x proj = x – x z / (d+z) = (dx + zx – xz) / (d+z) = x / (1 + (z/d))‏ y proj = y / (1 + (z/d))‏ How to use this information to generate a matrix that performs the perspective projection?

17 Michael Eckmann - Skidmore College - CS 325 - Spring 2010 One Point Perspecitve Perspective projection onto z=0 plane with CoP at (0,0,-d). [ 1 0 0 0 ] [ x ] [ x ] [ 0 1 0 0 ] [ y ] = [ y ] [ 0 0 0 0 ] [ z ] [ 0 ] [ 0 0 1/d 1 ] [ 1 ] [ (z/d) + 1 ]

18 Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Orthographic Projection What do you think a matrix for an orthographic projection onto the z=0 plane would look like? Orthographic means that the direction of the projectors is parallel to z-axis since the z=0 plane is orthogonal to the z- axis. The difference is that we do not have a finite CoP. Given a point in the world P = (x,y,z), what will be its projected point on the z=0 plane? So, what does the matrix look like?

19 Michael Eckmann - Skidmore College - CS 325 - Spring 2010 Orthographic Projection [ 1 0 0 0 ] [ x ] [ x ] [ 0 1 0 0 ] [ y ] = [ y ] [ 0 0 0 0 ] [ z ] [ 0 ] [ 0 0 0 1 ] [ 1 ] [ 1 ]


Download ppt "CS 325 Introduction to Computer Graphics 02 / 22 / 2010 Instructor: Michael Eckmann."

Similar presentations


Ads by Google