22
GVE, Hallym University, C hang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한한한한한 한한한한한한 한 한한

GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

Embed Size (px)

Citation preview

Page 1: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

1

Chap2. 3D Graphics Fundamentals

한림대학교 컴퓨터공학부송 창근

Page 2: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

2

What you’ll learn in this chapter

How the eyes perceive three dimensions How a 2D image can have the appearance

of 3D How Cartesian coord specify object

position What a clipping volume is How viewports affect image dimensions

Page 3: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

3

What you’ll learn in this chapter

How 3D objects are built from 2D primitives

How to work with Orthographics and Perspective Projections

Page 4: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

4

3D Perception

양쪽눈은 물체에 대해서 약간의

서로 다른 이미지를 바라본다 . 물체와 거리가 멀어지면 가

작아진다 . 반대로 거리가 가까와지면 의 값이 커진다 .

예 ) Viewmaster 혹은 3D 영화 거리 측정 실험 . ( 외눈 , 양안

사용 )

Page 5: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

5

2D + Perspective = 3D

Page 6: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

6

2D + Perspective = 3D

Perspective

• 가까이 있는 물체가 멀리 있는 물체보다 커 보이는 현상

• Perspective + Color changes, textures, lighting, and variations of color intensity — 3D image perception

• Perspective 만으로도 3 차원 인식 가능

•예 ) Fig. 2-2, Wireframe cube, 단점은 2 가지 형태로 보임 .

Page 7: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

7

• Fig. 2-2 전면과 후면을 구별하기 힘듬

• Fig. 2-2 가 solid 이면 후면은 전면에 의해 가려 지므로 후면을 볼 수 없다 . 따라서 전면과 후면을 혼동하지 않을 수 있음 .

• Fig. 2-3, Hidden lines are removed.

Hidden Line Removal

Page 8: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

8

Colors and Shading

Page 9: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

9

Colors and Shading

• Fig. 2-4 은 실제 물건 같지가 않다 . 육방체의 모든 면이 같은 색깔이다 .

• 현실감이 있게 보이도록 원근감을 갖도록 하려면

• 보이는 3 개의 면을 서로 다른 색으로 그리거나

• 보이는 3 개의 면을 같은 색으로 하되 빛의 조도에 따라서 shading 을 갖도록 한다 . (Fig. 2-5)

Page 10: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

10

Light and Shadows

빛의 효과 (Lighting) It causes a surface of a

uniform color to appear shaded (illuminated)

It cast a shadow Two source of light

– Ambient : undirected,

– Directional Point source, Lamp

Page 11: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

11

Coordinate Systems

How to draw 3D objects on the screen (2D)?

• Using output primitives such as points, lines, polygons etc.

• Position : (row, column)

• Standard VGA

• 640 pixels from left to right

•480 pixels from top to bottom

Page 12: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

12

2D Cartesian Coordinates

How to map the true coordinate to window coord.

Page 13: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

13

Coordinate ClippingTwo Clipping Areas : 0 x150, 0y100

-75x75, -50y50

( 참고사항 )Windows(Microsoft) : for positive y to move down from top to bottom of the window

Page 14: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

14

Viewports, Your Window to 3D

Fig. 2-9 A viewport defined as twice the size of the clipping area

Page 15: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

15

Viewports, Your Window to 3D

Fig. 2-10 A viewport defined as the same dimensions as the clipping area.

Page 16: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

16

Viewports, Your Window to 3D

Viewport : the region within the window’s client area

that will be used for drawing the clipping area

• Fig. 2-9 : Each increment in the logical coordinate system would be matched by 2 increments in the physical coordinate system of the window (pixel)

• Fig. 2-10 : shows a viewport that matches the clipping area.

• What if we set the viewport to be larger than the window client area?

Page 17: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

17

Drawing Primitives

Primitives : points, lines, and

polygons (a flat, multisided shape)

Page 18: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

18

3D Cartesian Coordinates

Z-axis (new axis), Right-Handed System(RHS)

Page 19: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

19

Projections, The Essence of 3D

Fig. 2-12. A 3D image projected onto a 2D surface

Page 20: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

20

Projections, The Essence of 3D

Projection :

It is like tracing the outlines of some object behind a piece of glass with black marker.

Clipping Volume :

you want to be displayed in your window.

Page 21: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

21

Orthographic Projection

• Orthographic parallel projection rectangular clipping volume

• Architectural design or CAD

Page 22: GVE, Hallym University, Chang Geun Song Ph.D. 1 Chap2. 3D Graphics Fundamentals 한림대학교 컴퓨터공학부 송 창근

GVE, Hallym University, Chang Geun Song Ph.D.

22

Perspective Projection

• Viewing volume : like a pyramid with the top shaved off

• Frustum

• More realistic, simulation, 3D animaton