Upload
verity-mason
View
224
Download
0
Embed Size (px)
Citation preview
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
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
GVE, Hallym University, Chang Geun Song Ph.D.
4
3D Perception
양쪽눈은 물체에 대해서 약간의
서로 다른 이미지를 바라본다 . 물체와 거리가 멀어지면 가
작아진다 . 반대로 거리가 가까와지면 의 값이 커진다 .
예 ) Viewmaster 혹은 3D 영화 거리 측정 실험 . ( 외눈 , 양안
사용 )
GVE, Hallym University, Chang Geun Song Ph.D.
5
2D + Perspective = 3D
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 가지 형태로 보임 .
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
GVE, Hallym University, Chang Geun Song Ph.D.
8
Colors and Shading
GVE, Hallym University, Chang Geun Song Ph.D.
9
Colors and Shading
• Fig. 2-4 은 실제 물건 같지가 않다 . 육방체의 모든 면이 같은 색깔이다 .
• 현실감이 있게 보이도록 원근감을 갖도록 하려면
• 보이는 3 개의 면을 서로 다른 색으로 그리거나
• 보이는 3 개의 면을 같은 색으로 하되 빛의 조도에 따라서 shading 을 갖도록 한다 . (Fig. 2-5)
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
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
GVE, Hallym University, Chang Geun Song Ph.D.
12
2D Cartesian Coordinates
How to map the true coordinate to window coord.
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
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
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.
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?
GVE, Hallym University, Chang Geun Song Ph.D.
17
Drawing Primitives
Primitives : points, lines, and
polygons (a flat, multisided shape)
GVE, Hallym University, Chang Geun Song Ph.D.
18
3D Cartesian Coordinates
Z-axis (new axis), Right-Handed System(RHS)
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
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.
GVE, Hallym University, Chang Geun Song Ph.D.
21
Orthographic Projection
• Orthographic parallel projection rectangular clipping volume
• Architectural design or CAD
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