Download presentation
Presentation is loading. Please wait.
Published byAnnabella Lamb Modified over 9 years ago
1
Transformation & Projection Feng Yu Proseminar Computer Graphics :
2
Transformations What is a transformation? What is a transformation? What kind of transformations are there? What kind of transformations are there? How can we compute them? How can we compute them?
3
Transformation : 2D Transformations 2D Transformations Homogeneous Coordinates and Matrix Representation of 2D Transformations Homogeneous Coordinates and Matrix Representation of 2D Transformations Matrix Representation of 3D Transformations Matrix Representation of 3D Transformations Transformations as a Change in Coordinate System Transformations as a Change in Coordinate System
4
2D Translations. P P’
5
2D Scaling from the origin. P P’
6
2D Rotation about the origin. y x r r P’(x’,y’) P(x,y)
7
2D Rotation about the origin. y x r r P’(x’,y’) P(x,y) y 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. Translation. P=T + PP=T + P Scale Scale P=S PP=S P Rotation Rotation P=R PP=R P We would like all transformations to be multiplications so we can concatenate them express points in homogenous coordinates. 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. Add an extra coordinate, W, to a point. P(x,y,W).P(x,y,W). Two sets of homogeneous coordinates represent the same point if they are a multiple of each other. 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.(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. 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, divide by it to get Cartesian coordinates of point (x/W,y/W,1). If W=0, point is said to be at infinity. If W=0, point is said to be at infinity.
12
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 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) If we homogenize the point, we get a point of form (x,y,1) homogenised points form a plane at W=1.homogenised points form a plane at W=1. P X Y W W=1 plane
13
Translations in homogenised coordinates Transformation matrices for 2D translation are now 3x3. Transformation matrices for 2D translation are now 3x3.
14
Concatenation. We perform 2 translations on the same point: 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
3D Transformations. Use homogeneous coordinates, just as in 2D case. Use homogeneous coordinates, just as in 2D case. Transformations are now 4x4 matrices. Transformations are now 4x4 matrices. We will use a right-handed (world) coordinate system - ( z out of page ). We will use a right-handed (world) coordinate system - ( z out of page ). z (out of page) y x Note: Convenient to think of display as Being left-handed !! ( z into the screen )
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. Need to specify which axis the rotation is about. z-axis rotation is the same as the 2D case. z-axis rotation is the same as the 2D case.
23
Rotation in 3D For rotation about the x and y axes: 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 Perspective Projection Parallel Projection Parallel Projection
27
Planar Geometric Projections Standard projections project onto a plane Standard projections project onto a plane Projectors are lines that either Projectors are lines that either converge at a center of projectionconverge at a center of projection are parallelare parallel Such projections preserve lines Such projections preserve lines but not necessarily anglesbut not necessarily angles Nonplanar projections are needed for applications such as map construction Nonplanar projections are needed for applications such as map construction
28
Perspective Projection
29
Parallel Projection
30
Taxonomy of Planar Geometric Projections paralle l perspective axonometric multiview orthographic oblique isometricdimetrictrimetric 2 point1 point3 point planar geometric projections
31
Orthographic Projection Projectors are orthogonal to projection plane
32
Multiview Orthographic Projection Projection plane parallel to principal face Projection plane parallel to principal face Usually form front, top, side views Usually form front, top, side views isometric (not multiview orthographic view) front side top in CAD and architecture, we often display three multiviews plus isometric
33
Advantages and Disadvantages Preserves both distances and angles Preserves both distances and angles Shapes preservedShapes preserved Can be used for measurementsCan be used for measurements Building plans Building plans Manuals Manuals Cannot see what object really looks like because many surfaces hidden from view Cannot see what object really looks like because many surfaces hidden from view Often we add the isometricOften 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 Can pick the angles to emphasize a particular face Architecture: plan oblique, elevation obliqueArchitecture: plan oblique, elevation oblique Angles in faces parallel to projection plane are preserved while we can still see “around” side 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) 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) 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) Drawing simple perspectives by hand uses these vanishing point(s) vanishing point
38
One-Point Perspective One principal face parallel to projection plane One principal face parallel to projection plane One vanishing point for cube One vanishing point for cube
39
Two-Point Perspective On principal direction parallel to projection plane On principal direction parallel to projection plane Two vanishing points for cube 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) Objects further from viewer are projected smaller than the same sized objects closer to the viewer (diminution) Looks realisticLooks realistic Equal distances along a line are not projected into equal distances (nonuniform foreshortening) Equal distances along a line are not projected into equal distances (nonuniform foreshortening) Angles preserved only in planes parallel to the projection plane 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) More difficult to construct by hand than parallel projections (but not more difficult by computer)
41
END Thank you for your attentions
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.