1 / 41

Transformation & Projection

Proseminar Computer Graphics :. Transformation & Projection. Feng Yu. Transformations. What is a transformation? What kind of transformations are there? How can we compute them?. Transformation :. 2D Transformations Homogeneous Coordinates and Matrix Representation of 2D Transformations

Download Presentation

Transformation & Projection

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. Proseminar Computer Graphics : Transformation & Projection Feng Yu

  2. Transformations • What is a transformation? • What kind of transformations are there? • How can we compute them?

  3. Transformation : • 2D Transformations • Homogeneous Coordinates and Matrix Representation of 2D Transformations • Matrix Representation of 3D Transformations • Transformations as a Change in Coordinate System

  4. P’ P 2D Translations.

  5. P’ P 2D Scaling from the origin.

  6. y  P’(x’,y’) P(x,y) r r x 2D Rotation about the origin.

  7. 2D Rotation about the origin. y P’(x’,y’) P(x,y) r  y r  x x

  8. 2D Rotation about the origin. Substituting for r : Given us:

  9. 2D Rotation about the origin. Rewriting in matrix form gives us :

  10. Transformations. • Translation. • P=T + P • Scale • P=S  P • Rotation • P=R  P • We would like all transformations to be multiplications so we can concatenate them  express points in homogenous coordinates.

  11. Homogeneous coordinates • Add an extra coordinate, W, to a point. • P(x,y,W). • Two sets of homogeneous coordinates represent the same point if they are a multiple of each other. • (2,5,3) and (4,10,6) represent the same point. • At least one component must be non-zero  (0,0,0) is not allowed. • If W 0 , divide by it to get Cartesian coordinates of point (x/W,y/W,1). • If W=0, point is said to be at infinity.

  12. W P W=1 plane X Y Homogeneous coordinates • If we represent (x,y,W) in 3-space, all triples representing the same point describe a line passing through the origin. • If we homogenize the point, we get a point of form (x,y,1) • homogenised points form a plane at W=1.

  13. Translations in homogenised coordinates • Transformation matrices for 2D translation are now 3x3.

  14. Concatenation. • We perform 2 translations on the same point:

  15. Concatenation. Matrix product is variously referred to as compounding, concatenation, or composition. This single matrix is called the Coordinate Transformation Matrix or CTM.

  16. Homogeneous form of scale. Recall the (x,y) form of Scale : In homogeneous coordinates :

  17. Concatenation of scales.

  18. Homogeneous form of rotation.

  19. y Note: Convenient to think of display as Being left-handed !! ( z into the screen ) x z (out of page) 3D Transformations. • Use homogeneous coordinates, just as in 2D case. • Transformations are now 4x4 matrices. • We will use a right-handed (world) coordinate system - ( z out of page ).

  20. Translation in 3D. Simple extension to the 3D case:

  21. Scale in 3D. Simple extension to the 3D case:

  22. Rotation in 3D • Need to specify which axis the rotation is about. • z-axis rotation is the same as the 2D case.

  23. Rotation in 3D • For rotation about the x and y axes:

  24. Transformations of coordinate systems.

  25. Transform Left-Right, Right-Left Transforms between world coordinates and viewing coordinates. That is: between a right-handed set and a left-handed set.

  26. Projections • Perspective Projection • Parallel Projection

  27. Planar Geometric Projections • Standard projections project onto a plane • Projectors are lines that either • converge at a center of projection • are parallel • Such projections preserve lines • but not necessarily angles • Nonplanar projections are needed for applications such as map construction

  28. Perspective Projection

  29. Parallel Projection

  30. Taxonomy of Planar Geometric Projections parallel planar geometric projections perspective 1 point 2 point 3 point multiview orthographic axonometric oblique isometric dimetric trimetric

  31. Orthographic Projection Projectors are orthogonal to projection plane

  32. Multiview Orthographic Projection • Projection plane parallel to principal face • Usually form front, top, side views isometric (not multiview orthographic view) front in CAD and architecture, we often display three multiviews plus isometric side top

  33. Advantages and Disadvantages • Preserves both distances and angles • Shapes preserved • Can be used for measurements • Building plans • Manuals • Cannot see what object really looks like because many surfaces hidden from view • Often we add the isometric

  34. Oblique Projection Arbitrary relationship between projectors and projection plane

  35. Advantages and Disadvantages • Can pick the angles to emphasize a particular face • Architecture: plan oblique, elevation oblique • Angles in faces parallel to projection plane are preserved while we can still see “around” side • In physical world, cannot create with simple camera; possible with bellows camera or special lens (architectural)

  36. Perspective Projection Projectors coverge at center of projection

  37. Vanishing Points • Parallel lines (not parallel to the projection plan) on the object converge at a single point in the projection (the vanishing point) • Drawing simple perspectives by hand uses these vanishing point(s) vanishing point

  38. One-Point Perspective • One principal face parallel to projection plane • One vanishing point for cube

  39. Two-Point Perspective • On principal direction parallel to projection plane • Two vanishing points for cube

  40. Advantages and Disadvantages • Objects further from viewer are projected smaller than the same sized objects closer to the viewer (diminution) • Looks realistic • Equal distances along a line are not projected into equal distances (nonuniform foreshortening) • Angles preserved only in planes parallel to the projection plane • More difficult to construct by hand than parallel projections (but not more difficult by computer)

  41. END Thank you for your attentions

More Related