25.353 lecture series - simon fraser...

29
1 Projection Projection 25.353 Lecture Series 25.353 Lecture Series Prof. Gary Wang Prof. Gary Wang Department of Mechanical and Department of Mechanical and Manufacturing Engineering Manufacturing Engineering The University of Manitoba The University of Manitoba

Upload: others

Post on 17-Apr-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

1

ProjectionProjection25.353 Lecture Series25.353 Lecture Series

Prof. Gary WangProf. Gary WangDepartment of Mechanical and Department of Mechanical and

Manufacturing EngineeringManufacturing EngineeringThe University of ManitobaThe University of Manitoba

Page 2: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

2

��Coordinate SystemsCoordinate SystemsLocal Coordinate System (LCS)World Coordinate System (WCS)Viewing Coordinate System (VCS)Screen Coordinate System (SCS)

��ProjectionProjectionParallel ProjectionPerspective Projection

��Lab 1Lab 1

OverviewOverview

Page 3: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

3

�Attached to the modeled object�Defines the size and shape of the object�Facilitates Geometric Construction

Local (Working) Coordinate Local (Working) Coordinate System (LCS)System (LCS)

AA

B

B

A

XX X

Page 4: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

4

�A Cartesian coordinate system independent of viewing or display

�Default coordinate system for a CAD package�Known as the scene universe�All geometrical data of modeled objects are

saved with respect to it.

World (Global or Model) World (Global or Model) Coordinate System (WCS)Coordinate System (WCS)

Yw

Zw

Xw

Page 5: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

5

TransformationTransformation� Translation, rotation, and reflection preserve the lengths of line

segments and the angles between segments.� Uniform scaling preserves angles but not lengths. � Nonuniform scaling and shearing do not preserve angles or

lengths;

Translation Rotation Uniform Scaling

Nonuniform Scaling Reflection Shearing

Page 6: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

6

Modeling TransformationModeling Transformation

From LCS to WCS (3D 3D)

Yw

Zw

Xw

ZL

YL

XL

Page 7: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

7

Transformation PipelineTransformation Pipeline

A sequence of transformations from the infinite and continuous three-dimensional WCS to the finite and discrete two-dimensional screen coordinate system

Page 8: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

8

ProjectionProjection

�Transforms a point in n-space to m-space (m < n), e.g. 3D 2D

�Terms� Center of projection (C) � Projection plane � Projectors

�Parallel Projection and Perspective Projection

Page 9: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

9

Parallel ProjectionParallel Projection

A

B

A’

B’C (at infinity)

Projection Plane

If the center of projection is at an infinite distance from the projection plane, all the projectors become parallel (meet at infinity) and parallel projection results.

� Parallelism preserved� Dimensions and shape preserved� Useful in engineering drawings.

Object

Projector

Page 10: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

10

Perspective ProjectionPerspective Projection

If the center of projection is at a finite distance from the projection plane, perspective projection results and all the projectors meet at the center of projection.

B

A’

B’

A

� Parallelism not preserved� Dimensions and angles changed� Applied to the artistic effect

Object

CProjection Plane

Projector

Page 11: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

11

Orthographic Projections Orthographic Projections (Parallel)(Parallel)

�� OrthographicOrthographicIf the direction of projection is normal to the projection plane, this type of parallel projection is orthographic projection.

� For engineering drawings - projection plane perpendicular to one of the principal axes of the WCS; that is, direction of projection coincides with one of principal axes of the WCS. Angles preserved but not necessarily lengths.

� Isometric projection

Page 12: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

12

Isometric projectionIsometric projection� Three principal axes (WCS) equally foreshortened on the

projection plane� Measurements along the axes of the WCS made with the

same scaleProjection

(Center of Projection and Projection Plane)

Perspective Projection

Parallel Projection(Projection Direction v.s. Projection Plane)

Orthographic Projection(Projection Plane v.s. WCS axes)

Oblique Projection

Engineering Drawing Isometric Projection

Iso -> equal

Metric -> measure

Page 13: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

13

Viewing Coordinate System Viewing Coordinate System (VCS)(VCS)

� 3D coordinate system (right-handed or left-handed)�Viewpoint (eye or camera) corresponds to the

center of projection

�View plane corresponds to the projection plane

�Zv defines the viewing direction (projection direction), which is normal to the view plane

View Plane

Yv

Xv

Zv

Viewing direction

Eye at infinity

Window

Page 14: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

14

Screen/Device Coordinate Screen/Device Coordinate System (SCS)System (SCS)

� 2D system to show the image on the display eventually� Device coordinate system� Measured by pixels for raster graphics displays

y s

x s O s 1

1

� A normalized SCS is called Virtual Device Coordinate System

X

Y Pixel (17, 17)

Page 15: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

15

Viewport MappingViewport MappingMap a 2D image to the Viewport on the Normalized SCS, and

finally, the 2D image will be mapped from the Normalized SCS to the SCS.

� ViewportA viewport is an area of the display screen on which the window data is presented.

(Kunwoo Lee, 1999)

Page 16: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

16

Transformation PipelineTransformation PipelineCoordinate Values in Local Coordiante System

Coordinate Values in World Coordiante System

Coordinate Values in Viewing Coordiante System

Coordinate Values in Window

Coordinate Values in Normalized Screen Coordinate System (Normalized Viewport)

Coordinate Values in Screen Coordinate System (Viewport)

Modeling Transforamtion

Viewing Transforamtion

Projection Transforamtion

Viewport Mapping

Yv

Zv

Xv

VCS

Yw

Zw

Xw

WCS

y s

x s O s 1

Yw

Zw

Xw

WCS

3D -> 3D

3D -> 3D

3D -> 2D

2D -> 2D

Page 17: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

17

A Graphic Illustration of 4 A Graphic Illustration of 4 Coordinate SystemsCoordinate Systems

(Kunwoo Lee, 1999)

Local Coordinate System

Page 18: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

18

Lab 1Lab 1

Table 1 Point coordinates of the object

7.27.2014

7.27.210.213

310.210.212

010.210.211

0010.210

3010.29

305.48

005.47

035.46

4.735.45

4.7304

310.203

010.202

0301

zyxPoints

ZV

XV

YV

Page 19: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

19

Xv, Xw

Front

Yv,Yw

Top

Xv, Xw

Yv

Zw

Right

Xv

Yv, Yw

Zw

Xv

Top

Right

Yv

Zv

Front

Xw

Zw

Yw

Align the VCS and the WCS along their corresponding axes and origins, and Zv defines the viewing direction. Use Yv-Xv plane as the view plane

FrontTop Right

Xw

Yw

Zw

Rotate properly and then project it

Xv

Yv

Zv

Page 20: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

20

FrontTop

Right

X

Y

Z

Front

Yv,Y

Xv, X

PPv

����

����

=

1000000000100001

Page 21: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

21

FrontTop

Right

X

Y

Z

Top

Xv, X

Yv

Z

( ) PPPv

����

����

−=

����

����

°°°−°

����

����

=

1000000001000001

10000)90cos(90sin00)90sin()90cos(0

0001

1000000000100001

90(CCW)

Page 22: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

22

FrontTop

Right

X

Y

Z

Right

Xv

Yv, Y

Z

( ) PPPv

����

����

� −

=

����

����

°−°−−

°−°−

����

����

=

1000000000100100

10000)90cos(090sin00100)90sin(0)90cos(

1000000000100001

-90(CW)

Page 23: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

23

Isometric Projection (Isometric Projection (Ry Ry ----> Rx )> Rx )Three principal axes (WCS) equally foreshortened on the viewing plane

Use unit vector along each direction representing the length for principal axes

Top

Right

Yv

Zv

Front

Xw

Zw

Yw

XvFront

TopRight

Xw

Yw

Zw

����

����

=

1111010000100001

P

θ φ

Projection plane: Yv-Xv

Page 24: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

24

P

PTyTxPv

����

����

−����

����

−=

=

10000cos0sin00100sin0cos

10000cossin00sincos00001

]][[

θθ

θθ

φφφφ

P

����

����

−−

=

10000coscossinsincos0cossincossinsin0sin0cos

θφφθφθφφθφ

θθ

Isometric Projection (Isometric Projection (Ry Ry ----> Rx )> Rx )θ φ

Page 25: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

25

φθθφ

φθθ

sincossin

cos0

sinsincos

−====

==

vv

vv

vv

yx

yx

yx

φφθθφφθθ

2222

2222

cossincossin

cossinsincos

=+=+

°±=°±= 26.35,45 φθ

Contd.

����

����

−−

=

10000coscossinsincos0cossincossinsin0sin0cos

θφφθφθφφθφ

θθ

Page 26: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

26

°±=°±= 26.35,45 yx rr• Rx --> Ry

• Rz --> Ry(Rx)

°±=°±= 74.54,45 )( xyz rr

• Rx(Ry) --> Rz

ANGLEANYrr zxy =°±= ,45)(

Other possible rotation pathsOther possible rotation paths

Page 27: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

27

Notes• The viewing coordinate system is different

from the ones in the notes, i.e., you cannot simply plug in the equation to create the orthographic views.

• Add a line between two points (x1,y1) and (x2, y2)– Plot([x1, x2],[y1, y2]);

• Erase a line�Plot([x1, x2],[y1, y2],’w’);• Rz=45o, Rx=-54.74o for the case

Page 28: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

28

Notes (cont’d)• You have to move the views to the right

spot as indicated in Figure 4 (translation?)• How to manage the points? Why?

– Arrange them sequentially in a matrix, then remove/add the necessary ones

– Group them to sub-matrices and transform them individually

– Create an index matrix letting the system know which ones are connected

Page 29: 25.353 Lecture Series - Simon Fraser Universitygwa5/index_files/25.353/indexf_files/4Projection-06.pdf · Parallel Projection A B A’ B’ C (at infinity) Projection Plane If the

29

Summary

• Graphical Coordinate Systems• Various Transformations• Orthographic Projection• Isometric Projection• Lab 1