chapter 8. three-dimensional object representations

74
2009-1 학학 Chapter 8. Three-Dimensional Object Representations 1 Chapter 8. Three-Dimensional Object Representations

Upload: ian-chavez

Post on 31-Dec-2015

81 views

Category:

Documents


5 download

DESCRIPTION

Chapter 8. Three-Dimensional Object Representations. Solid objects representation scheme. Boundary representation (B-reps) three-dimensional objects 를 , 물체의 내부와 외부를 분리하는 surface 의 집합으로 표현하는 것 전형적인 예로 polygon facets 와 spline patches 가 있음 Space-Partitioning representation - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 1

Chapter 8. Three-Dimensional Object Representations

Page 2: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 2

Solid objects representation schemeSolid objects representation scheme

Boundary representation (B-reps) three-dimensional objects 를 , 물체의 내부와 외부를 분리하는 surface 의

집합으로 표현하는 것 전형적인 예로 polygon facets 와 spline patches 가 있음

Space-Partitioning representation 물체를 포함하는 spatial region 을 small, nonoverlapping, contiguous solids

(usually cubes) 로 분할하여 내부의 성질을 표현하는데 이용 3 차원 물체에 대해선 octree-representation 이 대표적

Page 3: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 3

OpenGL Polyhedron FunctionsOpenGL Polyhedron Functions

OpenGL Regular Polyhedron Functions glutWireTetrahedron ( ); // 4 면체 glutSolidTetrahedron ( ); glutWireCube (edgeLength); glutSolidCube (edgeLength); glutWireOctahedron ( ); glutSolidOctahedron ( ); glutWireDodecahedron ( ); // 12 면체 glutSolidDodecahedron ( ); glutWireIcosahedron ( ); glutSolidIcosahedron ( );

Page 4: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 4

Quadric Surfaces Quadric Surfaces

quadric surfaces: 2 차 방정식을 이용하여 objects 를 표현 sphere, ellipsoid, tori, paraboloids( 포물면 ), hyperboloids ( 쌍곡면 ) 이 포함됨

Sphere x2 + y2 + z2 = r2 으로 표현 latitude( 위선 ) angle 과 longitude( 경선 ) angle 을 이용한 parametric form 으로

표현하면 ( 그림 8-2) x = rcos cos y = rcos sin z = rsin

Page 5: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 5

Parametric Coordinate positionParametric Coordinate position

P = (x, y, z)

r

X

Y

Z

Page 6: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 6

Ellipsoid ( 타원체 ) 서로 다른 값을 가지며 서로 수직인 세 개 반지름으로 표현 (x / rx)

2 + (y / ry)2 + (z / rz)

2 = 1

parametric form 으로 표현하면 x = rxcos cos

y = rycos sin

z = rzsin

Torus ( 윤환체 ) 도넛 모양의 물체 circle 이나 conic 을 어떤 축을 중심으로 회전시켰을 때 생김

Page 7: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 7

( 그림 8-5)

[ r - (x/rx)2 + (y/ry)

2 ]2 + (z/rz)2 = 1

parametric form

x = rx(r+cos)cos

y = ry(r+cos)sin

z = rzsin

 

Page 8: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 8

SuperquadricsSuperquadrics

superquadrics: quadric representation 을 일반화시킨 것 quadric equations 에 파라미터를 추가시켜서 object shape 를 조정하기 위한

flexibility 를 제공함 추가되는 파라미터는 object dimension 을 나타냄 curve 에 대해선 one parameter surface 에 대해선 two parameters

Page 9: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 9

SuperellipseSuperellipse

x, y 항에 대한 지수를 변형시킴 (x/rx)

2/s + (y/ry)2/s = 1

파라미터 s 는 real value superellipse 에 대한 parametric equations

x = rxcoss

y = rysins ( 그림 8-6)

Page 10: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 10

Superellipsoid Superellipsoid

two exponent parameters 를 포함시켜서 얻음 [ (x/rx)

2/s2 + (y/ry)2/s2]s2/s1 + (z/rz)

2/s1 = 1

parametric equations

x = rxcoss1 coss2

y = rycoss1 sins2

z = rzsins1

Page 11: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 11

GLUT Quadric-Surface Functions glutWireSphere (r, nLongitudes, nLatitudes); glutSolidSphere (r, nLongitudes, nLatitudes); glutWireCone (rBase, height, nLongitudes, nLatitudes); glutSolidCone (rBase, height, nLongitudes, nLatitudes); glutWireTorus (rCrossSection, rAxial, nConcentrics, nRadiaSlices); glutSolidTorus (rCrossSection, rAxial, nConcentrics, nRadialSlices);

GLUT Cubic-Surface Teapot Function glutWireTeapot (size); glutSolidTeapot (size);

 

Page 12: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 12

GLU Quadric-Surface Functions GLUquadricobj *sphere1; gluSphere (sphere1, r, nLongitudes, nLatitudes);

기타 책 참고 

Page 13: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 13

blobby objectsblobby objects

molecular structures, water droplets, melting objects, muscle shape 등과 같이 fixed shape 을 갖지않고 표면의 모양이 변화하는 것

molecular shape: isolation 형태에서는 sphere 로 표현되나 다른 molecule 로 접근하면 모양이 변하게 됨 . 이것은 two molecules 의 “ bonding” 의 성질 때문임 ( 그림 8-9)

blobby objects 를 표현하는 방법으로 Gaussian density functions (bumps) 이용 ( 그림 8-11) 하여 다음의 surface

function 으로 구함 f(x, y, z) = bke

-akrk2 - T = 0

r = x2 + y2 + z2

T: threshold a, b: blobbiness 를 조정하기 위한 파라미터

Page 14: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 14

Spline RepresentationsSpline Representations

spline curve first and second derivatives 가 여러 curve sections 을 통해 continuous 한 a

piecewise cubic polynomial function 으로 구할 수 있다 . 즉 , spline curve 란 각 picece 의 boundary 에서 continuity condition 을

만족하는 polynomial sections 들로 구성된다 . spline surface

two sets of orthogonal spline curves 로 정의됨

interpolation and approximation splines a set of coordinate positions (control points) 가 주어졌을 때 spline curve 는

다음의 두 가지 방법으로 정의됨

Page 15: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 15

1) curve 가 각 control points 를 지나가도록 polynomial sections 을 구성 -> interpolate control points ( 그림 8-14)

=> digitize drawings, specify animation path 등에 이용2)control points 를 통과하는 것이 아니고 general control-point path 를 따라 curve

형성 -> approximate control points ( 그림 8-15)

=> design tools to structure object shapes 에 이용

convex hull control points 로 둘러싸인 convex polygon boundary 를 의미

Page 16: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 16

A set of points interpolated with piecewise continuous polynomial sections

A set of control points approximated with piecewise continuous polynomial sections

Page 17: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 17

Parametric Continuity ConditionsParametric Continuity Conditions

piecewise parametric curve 의 한 section 에서 다음 section 으로 smooth transition을 위해선 connection points 에서 continuity conditions 를 만족해야 함

spline 의 각 section 이 다음의 parametric coordinate functions 으로 정의됨을 가정 x = x(u) y = y(u) z = z(u), u1 <= u <= u2

zero-order parametric continuity: C0 continuity 라고 함 단순히 서로 만나는 것을 의미 first curve section 의 u2 에서의 x, y, z 값이 next curve section 의 u1 에서의

z, y, z 값이 같음

Page 18: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 18

first order parametric continuity: C1 continuity two succesive curve sections 에서의 coordinate functions 의 first parametric

derivatives (tangent lines) 이 jointing point 에서 같은 값을 가짐

second order parametric continuity: C2 continuity intersection 에서 two curve sections 의 first and second parameteric derivatives

가 같음을 의미

( 그림 8-19)

Page 19: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 19

(a)(b)

(c)(a) zero-order continuity

(b) first-order continuity

(c) second-order continuity

Page 20: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 20

Geometric continuityGeometric continuity

two successive curve sections 을 연결할 때 two sections 의 parametric derivatives가 같은 것을 이용하는 것이 아니고 서로 비례하도록 한 것

zero-order geometric continuity: G0 continuity zero-order parametric continuity 와 같음 즉 , two curve sections 의 boundary point 에서 같은 coordinate position 을

갖는다 . first-order geometric continuity: G1 continuity

parametric first derivatives 가 two successive sections 의 intersection 에서 서로 비례값을 갖는다 .

second-order geometric continuity: G2 continuity first and second parametric derivatives 가 boundary 에서 서로 비례값을 갖는

다 . geometric continuity conditions 로 생성한 curve 는 parametric continuity 를 이용한

것과 비슷하나 curve shape 에 약간 차이가 있다 . ( 그림 8-20)

Page 21: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 21

p1p2

p0

p1 p2

C1

C2

C1

C3

(a) (b)

Three control points with two curve sections with

(a) parametric continuity and

(b) geometric continuity

Page 22: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 22

Spline specificationsSpline specifications

a spline section 에서 x coordinate 가 다음의 식으로 나타내진다고 가정 x(u) = axu

3 + bxu2 + cxu + dx 0 <= u <= 1

1) spline 에 주어진 boundary conditions 으로 나타냄 boundary conditions 가 x(0), x(1), x’(0), x’(1) 로 나타내짐

2) matrix 로 표현 ax

x(u) = [u3 u2 u 1] bx

cx

dx

= U · C boundary conditions 을 matrix 형태로 표현하고 coefficient matrix C 를 구할 수 있음

Page 23: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 23

C = Mspline • Mgeom

Mgeom 은 geometric constraint value (boundary conditions) 를 포함하는 four-

element column matrix 이고 Mspline 은 geometric constraint values 를 polynomial coefficients 로 변형시키기 위한 4 by 4 matrix 이다 (basis matrix 라고도 함 )

3) 위의 x(u) 는 다음의 matrix form 으로 바꾸어 표현할 수 있다 :

x(u) = U · Mspline · Mgeom

위의 matrix 형태는 polynomial representation 으로 바꾸어 표현하면x(u) = gk · BFk(u)

where gk : constraint parameters (control-point coordinates, slope)

BFk(u): polynomial blending functions

Page 24: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 24

Cubic Spline Interpolation MethodsCubic Spline Interpolation Methods

control points 가 주어졌을 때 a piecewise cubic polynomial curve 를 이용하여 모든 control points 를 통과하도록 하는 cubic interpolation splines 를 구할 수 있다

each pair of control points 에 대해 다음의 방정식으로 나타낼 수 있다 (parametric cubic polynomial)

x(u) = axu3 + bxu

2 + cxu + dx

y(u) = ayu3 + byu

2 + cyu + dy

z(u) = azu3 + bzu

2 + czu + dz

Page 25: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 25

p0

p1

p2

pn

A piecewise continuous cubic-spline interpolation of n+1 control points

Page 26: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 26

Natural Cubic SplinesNatural Cubic Splines

two adjacent curve sections 는 common boundary 에서 the same first and second derivatives 를 갖는다 . -> C2 continuity 를 가짐

n+1 control points 가 주어졌을 때 n curve sections 을 갖고 전체 4n polynomial coefficients 를 결정해야 함 n-1 interior control points 에서 four boundary conditions 을 갖는다 control point 양측의 two curve sections 는 the same first and second parametric

derivatives 를 가져야 한다 . 각 curve 는 반드시 그 control point 를 지나가야 한다 .

이상의 조건에서 4n-4 equations 가 생성됨 first control point and last control point 에서 각각 하나씩의 equation 이 얻어짐

Page 27: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 27

two more additional conditions 가 필요 one method 로

p0, pn 에서의 second derivatives 를 0 으로 함 다른 방법으로는

two extra dummy control points 를 양 끝에 하나씩 추가시킨다 .

모든 original control points 가 interior points 가 되고 4n boundary conditions 를 갖게 됨

단점 : any one control point 의 위치가 변경하면 전체 curve 에 영향을 미침 즉 , local control 을 허용하지 않음

Page 28: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 28

Hermite InterpolationHermite Interpolation

각 control point 에서 a specified tangent 로 piecewise cubic polynomial 을 interpolating 함

natural cubic splines 와 다르게 Hermite splines 는 각 curve section 이 자신의 endpoint constraints 에만 의존하기 때문에 local control 이 가능함

P(u) 가 control points pk, pk+1 사이의 curve section 에 대한 parametric cubic point

function 이라고 하면 Hermite curve section 을 정의하는 boundary conditions 는 다음과 같다 P(0) = pk

P(1) = pk+1

P’(0) = Dpk

P’(1) = Dpk+1

where Dpk , Dpk+1 는 control points pk, pk+1 에서 parametric derivatives (slope of

the curve) 값을 지정함

Page 29: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 29

P(u) = (x(u), y(u), z(u))

pk

Pk+1

Parametric point function P(u) for a Hermite curve section

Page 30: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 30

Hermite curve section 은 다음의 식으로 나타낼 수 있슴 P(u) = au3 + bu2 + cu + d 0 <= u <= 1

where P 의 x-component 는 x(u) = axu3 + bxu

2 + cxu + dx

y-component 는 y(u) = ayu3 + byu

2 + cyu + dy

z-component 는 z(u) = azu3 + bzu

2 + czu + dz

P(u), P’(u) 를 matrix form 으로 나타내면 a

P(u) = [u3 u2 u 1] b

c

d

Page 31: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 31

a

P’(u) = [3u2 2u 1 0] b

c

d

위의 두 방정식에 파라미터 u 값 0 과 1 을 넣으면 Hermite boundary conditions는 다음의 matrix form 으로 표현됨

pk 0 0 0 1 a

pk+1 = 1 1 1 1 · b

Dpk 0 0 1 0 c

Dpk+1 3 2 1 0 d

 

Page 32: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 32

이것을 polynomial coefficients 에 대해 풀면

a 0 0 0 1 -1 pk

b = 1 1 1 1 · pk+1

c 0 0 1 0 Dpk

d 3 2 1 0 Dpk+1

2 -2 1 1 pk

= -3 3 -2 -1 · pk+1

0 0 1 0 Dpk

1 0 0 0 Dpk+1

Page 33: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 33

  pk

= MH · pk+1

Dpk

Dpk+1

 

where MH는 boundary constraint matrix 의 inverse 인 Hermite matrix 이다 이것을 이용하여 P(u) 를 다음과 같이 나타낼 수 있다

  pk

P(u) = [u3 u2 u 1] · MH · pk+1

Dpk

Dpk+1

Page 34: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 34

  

= pk (2u3 - 3u2 + 1) + pk+1(-2u3 + 3u2) + Dpk(u3 - 2u2 + u) +

Dpk+1 (u3 - u2)

= pkH0(u) + pk+1H1(u) + DpkH2(u) + Dpk+1H3(u)

 

polynomial Hk(u) for k=0,1,2,3 을 blending functions 이라고 함

Page 35: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 35

Cardinal Splines => 생략Cardinal Splines => 생략 Hermite splines 와 마찬가지로 각 curve section 의 경계에서 지정된 endpoint

tangent 로 piecewise cubics 을 보간한다 . 차이점은 endpoint tangent 값을 직접 주지 않는다는 것 cardinal spline 에서는 하나의 control point 에서의 기울기 값은 두개의

인접한 control points 로부터 계산된다 ( 그림 8-25) 하나의 cardinal spline section 은 4 개의 연속적인 control points 로부터

지정된다 . 가운데 두개의 control points 가 section endpoints 이고 , 다른 2 개 points 가 endpoint 의 기울기를 계산하는데 이용된다 .

( 그림 8-26) 에서 cardinal spline section(P(u)) 을 위한 boundary conditions 은 P(0) = pk

P(1) = pk+1

P’(0) = (1/2)(1-t)(pk+1 – pk-1)

P’(1) = (1/2)(1-t)(pk+2 – pk)

Page 36: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 36

where t: tension parameter -> cardinal spline 이 input control points 에 맞추어지는 정도 (loosely or tightly) ( 그림 8-27)

위의 boundary condition 을 matrix 형태로 바꾸면 ,  

pk-1

P(u) = [u3 u2 u 1] MC pk

pk+1

pk+2

 

where MC =

-s 2-s s-2 s

2s s-3 3-2s -s

-s 0 s 0

0 1 0 0

s = (1-t)/2

 

Page 37: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 37

polynomial form 으로 나타내면

P(u) = pk-1(-su3 + 2su2 – su) + pk[(2-s)u3 + (s-3)u2 + 1] + pk+1[(s-2)u3 + (3-2s)u2 + su] +

pk+2(su3 – su2)

= pk-1CAR0(u) + pkCAR1(u) + pk+1CAR2(u) + pk+2CAR3(u)

where CARk(u), k=0, 1, 2, 3: cardinal blending functions ( 그림 8-28)

Page 38: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 38

Bezier Spline CurvesBezier Spline Curves

Bezier curves spline approximation method interpolation splines 에서와 같이 boundary conditions, matrix, blending functions

으로 나타낼 수 있으나 blending functions 으로 나타내는 것이 가장 일반적이다 .

n+1 control points 가 주어졌을 때 , pk = (xk, yk, zk), 0 <= k < n, 이 coordinate points 가 blend 되어 p0 에서 pn 사이에서 Bezier polynomial

function 의 path 를 기술하는 position vector P(u) 를 생성 :

P(u) = pk ·BEZk,n(u) 0 <= u <= 1

Bezier blending function BEZk,n(u) 은 Bernstein polynomials 로 다음과 같다

BEZk,n(u) = C(n, k) uk (1-u)n-k

C(n, k) 는 binomial coefficient

n!(n-k)!k!

Page 39: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 39

Bezier blending function 은 recursive calculation 으로 정의할 수 있다 :

BEZk,n(u) = (1-u) BEZk,n-1(u) + u BEZk-1,n-1(u) n > k >= 1

각 curve coordinates 에 대해 three parametric equations 로 표현 x(u) = xkBEZk,n(u)

y(u) = ykBEZk,n(u)

z(u) = zkBEZk,n(u)

Page 40: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 40

Properties of Bezier CurvesProperties of Bezier Curves

Bezier curve 는 first and last control points 를 항상 지난다 . curve 의 two ends 에서의 boundary conditions 는 P(0) = P0 P(1) = Pn endpoints 에서의 first derivatives 는 control point coordinates 로 부터 다음과 같이

계산됨P’(0) = -np0 + np1

P(u) = p0 BEZ0,n(u) + p1 BEZ1,n(u)

= p0 {c(n,0)u0(1-u)n } + p1 {c(n,1)u(1-u)n-1}

= p0 {(1-u)n} + np1{u(1-u)n-1}

P’(u) = -np0(1-u)n-1 + np1{(1-u)n-1 - (n-1)u(1-u)n-2} 에서 구해짐

Page 41: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 41

P’(1) = -npn-1 + npn

curve 의 시작점에서의 slope 는 first two control points 를 join 하는 line 을 따르게되며 마지막점에서의 slope 는 last two control points 를 join 하는 line 을 따르게 됨

endpoints 에서의 parametric second derivatives 는 다음의 식에서 구해짐 P”(0) = n(n-1)[(p2 - p1) - (p1 - p0)]

P”(1) = n(n-1)[pn-2 - pn-1] - (pn-1 - pn)]

Bezier curve 는 control points 의 convex hull 내에 존재한다 .

Page 42: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 42

Cubic Bezier CurvesCubic Bezier Curves

대부분의 그래픽스 패키지는 cubic spline functions 를 제공한다 . Cubic Bezier curve 는 four control points 로 생성되며 four blending functions 는

다음과 같다 BEZ0,3(u) = (1-u)3

BEZ1,3(u) = 3u(1-u)2

BEZ2,3(u) = 3u2(1-u)

BEZ3,3(u) = u3

blending functions 의 모양이 control points 가 파라미터 u 에대한 곡선의 모양에 어떤 영향을 미칠지를 결정한다 u=0 이면 nonzero blending function 은 1 값을 갖는 BEZ0,3이다 .

u=1 이면 nonzero blending function 은 1 값을 갖는 BEZ3,3 이다 .

따라서 cubic Bezier Curve 는 항상 p0 와 p3 을 통과한다 .

BEZ1,3, BEZ2,3 는 파라미터 u 의 중간 값에서 곡선의 형태에 영향을 미친다 . -> p1, p2 쪽으로 향하도록 한다 .

BEZ1,3은 u = 1/3 에서 maximum 이고 BEZ2,3은 u=2/3 에서 maximum 이다 .

Page 43: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 43

1

1

1

1

1

1

1

1

BEZ0,3(u) BEZ1,3(u)

BEZ3,3(u)BEZ2,3(u)

The four blending functions for cubic curves (n=3)

Page 44: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 44

four blending functions 은 parameter u 값이 전 영역에 걸쳐 nonzero 이므로 Bezier Curve 는 곡선 형태를 local control 할 수 없게 된다 .-> control point하나라도 위치가 바뀌면 전체 곡선에 영향을 미침

cubic Bezier curve 의 end positions 에서 parametric first derivatives 는 P’(0) = 3(p1 - p0) P’(1) = 3(p3 - p2)

parametric second derivativs 는 P”(0) = 6(p0 - 2p1 + p2) P”(1) = 6(p1 - 2p2+p3)

C1 혹은 C2 continuity 를 갖는 piecewise curves 생성에 위의 derivatives 를 이용

Page 45: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 45

cubic Bezier point function 을 matrix form 으로 나타내면 p0

P(u) = [u3 u2 u 1] MBEZ p1

p2

p3

where -1 3 -3 1

MBEZ = 3 -6 3 0

-3 3 0 0

1 0 0 0

Page 46: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 46

Bezier SurfacesBezier Surfaces

two sets of orthogonal Bezier curves 를 사용하여 input mesh of control points 를 지정해서 object surface 를 설계할 수 있음

m n

P(u, v) = pj,k BEZj,m(v) BEZk,n(u)

j=0 k=0

where pj,k 는 (m+1) by (n+1) control points 의 위치를 지정함

Page 47: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 47

B-Spline CurvesB-Spline Curves

two advantages over Bezier splines B-spline polynomial 의 degree 는 control points 수에 관계없이 설정할 수

있다 . spline curve or surface 의 모양에 대한 local control 을 허용

disadvantage more complex than Bezier surfaces

B-Spline curves

n

P(u) = pk Bk,d(u), umin <= u <= umax, 2 <= d <= n+1

k=0

where pk: an input set of n+1 control points B-splines 의 local control 은 u 의 total range 중의 subintervals 에 대한 blending

functions 를 정의하여 얻어짐

Page 48: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 48

B-splines 의 blending functions: Cox-deBoor recursion formulas 이용

Bk,1(u) = 1 if uk <= u <= uk+1

0 otherwise

u - uk uk+d - u

Bk,d(u) = Bk,d-1(u) + Bk+1,d-1(u)

uk+d-1 - uk uk+d - uk+1

각 blending function 은 d subintervals 에서 정의 각 subinterval 의 uj 를 knot 라고 함 선택된 subinterval endpoints 전체를 knot vector 라고 함

Page 49: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 49

B-Splines 의 특성B-Splines 의 특성 polynomial curve 는 degree d-1 이며 u 의 범위에서 Cd-2 continuity 를 갖는다 n+1 control points 에 대해 curve 는 n+1 blending functions 으로 나타낸다 .

각 blending function Bk,d 는 u 의 total range 중 d subintervals 에서 정의되며 knot

value uk에서 시작한다 .

파라미터 u 의 range 는 knot vector 에서 지정된 n+d+1 values 에 의해 n+d subintervals 로 분할된다 .

knot values 가 {u0, u1, ..., un+d} 이면 B-spline curve 는 knot value 가 ud-1 부터 un+1까지 구간에서 정의된다 .

spline curve 의 각 section 은 d control points 에 의해 영향을 받는다 . one control point 는 기껏해야 d curve sections 에 영향을 미친다 .

Page 50: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 50

1 1

1 1

B0,3(u) B1,3(u)

B3,3(u)B2,3(u)

1 2 3 4 5 6

Fig.8-42 Periodic blending functions for n=d=3 and a uniform, integer knot vector

Fig.8-42 Periodic blending functions for n=d=3 and a uniform, integer knot vector

Page 51: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 51

knot values ud-1 부터 un+1까지 구간에서 모든 basis functions 의 합은 1 이다 .

n

Bk,d(u) = 1

k=0 Three general classifications for knot vectors: uniform, open uniform, nonuniform Uniform, Periodic B-Splines

knot values 사이의 spacing 이 constant 할 때 uniform B-spline 이라고 함 예 ) {-1.5, -1.0, -0.5, 0.0, 0.5, 1.0, 1.5, 2.0} 때때로 knot values 가 0 과 1 사이로 normalize 되어 {0.0, 0.2, 0.4, 0.6, 0.8,

1.0} {0, 1, 2, 3, 4, 5, 6, 7} 의 형태로 많이 쓰임 uniform B-splines 는 periodic blending functions 를 가짐 -> n, d 가 주어졌을

때 all blending functions 는 same shape 를 갖는 것을 말함 ( 그림 8-42) Example 8-1 Uniform Quadratic B-Splines

Page 52: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 52

Cubic, periodic B-splines, open Uniform B-splines, nonuniform B-splines -> 책 참고

B-Spline Surfaces Bezier splines 와 비슷하게 B-spline surface 의 vector point function 은 B-

spline blending functions 의 Cartesian product 로 구해짐 식 8-64

 nu nv

P(u) = pku, kv Bku,du(u) Bkv,dv(v)

ku =0 kv =0

Page 53: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 53

OpenGL Approximation-Spline FunctionsOpenGL Approximation-Spline Functions

OpenGL Bezier-Spline Curve Functions glMap1* (GL_MAP1_VERTEX_3, uMin, uMax, stride, nPts, *ctrlPts); glEnable (GL_MAP1_VERTEX_3); glDisable (GL_MAP1_VERTEX_3);

suffix code: f or d uMin, uMax: curve parameter u, 보통은 0 과 1 ctrlPts: Bezier control points stride: ctrlPts 에서 data value 의 수를 나타내는 integer offset, 3 차원의 경우엔 stride = 3

glEvaluate1* (uValue); // evaluate position along the spline path

Page 54: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 54

사용 예사용 예 Glfloat ctrlPts[4][3] = {{-40.0, 40.0, 0.0}, {-10.0, 200.0, 0.0}, {10.0, -200.0, 0.0}, {40.0,

40.0, 0.0}; GlMaplf (GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, *ctrlPts); GlEnable (GL_MAP1-VERTEX_3);

  GLint k;

  glColor3f (0.0, 0.0, 1.0); // Set line color to blue glBegin (GL_LINE_STRIP); for (k = 0; k <= 50; k++) glEvalCoordlf (Glfloat (k) / 50.0); glEnd ( );

Page 55: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 55

  

glColor (1.0, 0.0, 0.0); // Set point color to red glPointSize (5.0); glBegin (GL_POINTS); for (k = 0; k < 4; k++); glVertex3fv (&ctrlPts[k][0]); glEnd ( );

OpenGL Bezier-Spline Surface Functions glMap2* (GL_MAP2_VERTEX_3, uMin, uMax, uStride, nuPts, vMin, vMax, vStride,

nvPts, *ctrlPts); glEnable (GL_MAP2_VERTEX_3); glDisable (GL_MAP2_VERTEX_3);

Page 56: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 56

Sweep RepresentationsSweep Representations

translational, rotational, or other symmetries 를 보유한 3D 물체를 만드는데 편리 two dimensional shape 와 a sweep 을 이용하여 물체를 표현함 circle 혹은 rectangle 과 같은 primitives 가 menu options 로 제공됨 ( 그림 8-55), ( 그림 8-56) 참고 

Page 57: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 57

P(u)

p1

p0

p2

p3

(a)

P(u,v)u

v

Fig. 8-55 Constructing a solid with a translational sweep

Page 58: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 58

Constructive Solid-Geometry MethodsConstructive Solid-Geometry Methods

set operations 를 이용하여 3 차원 물체의 volume 을 결합하는 방법으로 solid modeling

two specified volumes 에 union, intersection, difference operation 을 수행하여 new volume 을 생성

예 : ( 그림 8-57) ( 그림 8-58) primitives (blocks, pyramids, cylinders, cones, spheres and closed spline surfaces 등 ) 이

menu options 으로 제공됨 primitives 를 이용하여 set operation (union, intersection, difference) 로 새로운

물체를 생성하고 다시 이 물체를 set operation 에 이용하여 final object 를 만든다 .

( 그림 8-59)

Page 59: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 59

(a) (b)

Fig.8-57 Combining two objects with a union operation

Page 60: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 60

CSGObject

oper1 oper2

obj1 obj2 obj4 oper2

obj2 obj3

Fig.8-59 A CSG tree representation for an objectFig.8-59 A CSG tree representation for an object

Page 61: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 61

OctreesOctrees

Octrees: medical imaging applications 등에서 solid objects 표현을 위해 쓰이는 hierarchical tree structure

object cross sections 표현 tree structure 의 각 노드는 3 D space 의 한 region 을 나타냄 spatial coherence 의 성질을 이용해 3D objects 를 나타내는데 필요한 storage

requirements 를 줄일 수 있음

Page 62: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 62

Quadtree: 2D region 을 다시 quadrants 로 분할해 감 quadtree 의 각 노드는 quadrants 를 가리키는 4 elements 로 구성됨 ( 그림 8-63) a quadrant 내 모든 픽셀의 색이 same color 이면 (homogeneous quadrant) 해당

data element 는 그 color 를 저장하고 , homogeneous quadrant 임을 나타내기 위해 data element 내 flag 를 set 함

heterogeneous quadrants 의 경우엔 다시 quadrants 로 분할되고 heterogeneous 를 나타내도록 flag 가 set 되고 quadtree 의 다음 노드의 포인터를 저장한다 .

heterogeneous quadrant 의 경우 homogeneous quadrants 로 구성될 때까지 계속하여 분할해 간다 .

( 그림 8-64), ( 그림 8-65)

Page 63: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 63

0 1

3 2

0 1 2 3

0 1 2 3

Fig.8-64 Region of a two-dimensional space with two levels of quadrant divisions and the associated quadtree representation

Fig.8-64 Region of a two-dimensional space with two levels of quadrant divisions and the associated quadtree representation

Page 64: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 64

Octree-encoding schemes 3 dimensional space (cube) 를 octants 로 분할하여 tree 의 각 노드에 8 data

elements 를 저장한다 . octants 의 각 element 를 volume element or voxel이라고 함

an octant 내 모든 voxel 이 same type 이면 그 노드의 해당하는 data element에 그 type value 를 저장한다 .

heterogeneous octant 의 경우엔 다시 octants 로 분할된다 . homogeneous octants 로만 구성되도록 분할해 간다 . ( 그림 8-66)

BSP Trees

  octree encoding 과 비슷하나 two partitions 로 나눈다는 것이 차이 - Binary

Space Partitioning (BSP) tree

Page 65: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 65

Fig.8-66 Region of a three-dimensional space divided into numbered octants and the associated octree node with eight data elements

Fig.8-66 Region of a three-dimensional space divided into numbered octants and the associated octree node with eight data elements

0 1 2 3 4 5 6 7

0

1

2

3

4

5

7

Page 66: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 66

Fractal-Geometry MethodsFractal-Geometry Methods

natural objects (mountain, clouds) 의 경우엔 Euclidean-geometry methods(object shape 를 equation 으로 기술 ) 로는 나타내기 어렵다 .

fractal-geometry methods 로 표현 : procedures 사용 fractal object 가 갖는 두 가지 특성

infinite detail at every point self-similarity between the object parts and the overall features of the object

fractal object object subparts 의 detail 한 부분을 생성하는 repeated operation 을 나타내는

프로시듀어로 기술함 fractal representations

terrain, clouds, water, trees, plants, feathers, fur, textures 등 표현

Page 67: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 67

Fractal-Generation Procedures 한 space region 내에의 모든 점들에 대해 특정 변환함수를 반복적으로

적용하여 fractal object 를 생성함 P0 = (x0, y0, z0) 이면 transformation function F 를 반복 적용하여 계속된

levels of detail 을 구함 P1 = F(P0), P2 = F(P1), P3=F(P2),...

( 그림 8-70) ( 그림 8-71)

 

Page 68: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 68

Particle SystemsParticle Systems

자연 물체 혹은 불규칙적인 모양의 물체 중에서 유체적 속성을 나타내는 방법으로 모델링하는 기법

시간에 흐름에 따라 흘러간다든지 , 파도가 친다든지 , 튀거나 흩어지는 모습을 나타냄

clouds, smoke, fire, fireworks, waterfall, water spray 등 표현에 이용 정의된 공간 내에서 random processes 를 이용하여 시간에 따라 파라미터 값을

변화시키면서 물체를 생성해내고 random time 이 지나면 생성된 물체가 제거되도록 함

particle 의 lifetime 중에 그것의 경로나 표면의 특성이 색으로 표현되기도 함

Page 69: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 69

파티클의 모양 : 작은 구 , 타원체 , 상자 혹은 다른 모양으로 표현

시간에 따라 파티클 모양이 바뀌기도 함 파티클의 투명도 , 색 , 움직임이 바뀌기도 함 응용에 따라 파티클 움직임이 특정 힘에 의해 조정되기도 함 파티클이 움직이면서 경로가 지정된 색으로 디스플레이 됨

물리 기반 모델링 (Physically Based Modeling)  physically based modeling: 물체의 운동을 외적 및 내적 힘의 상호작용으로

기술하는 방법을 말함 nonrigid object (rope, cloth, soft rubber ball 등 ) 표현에 이용 책 참고

Page 70: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 70

Visualization of Data setsVisualization of Data sets

과학적 가시화 (scientific visualization) 그래픽스 방법을 이용해서 data sets 을 가시화하는 것 data sets 은 공간 분포와 데이터형에 따라 분류됨 2 차원 data sets 은 면에 걸쳐 분산된 값을 가지며 3 차원 data sets 는 정육면체나 구와 같은 한 공간 내에 분산된 값을 갖는다 . 데이터 형으로는 scalars, vectors, tensors, multivariate data 등을 가짐 

Page 71: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 71

스칼라 (scalar) 필드의 시각적 표현 Scalar quantity: 단일 값을 갖는 것 scalar data sets: 시간이나 위치에 따라 변하는 값을 갖기도 하고 다른 스칼라 파라미터의 함수로 나타내는 값을 갖기도 함

예 : energy, density, mass, temperature, pressure, charge, resistance, reflectivity, frequency, water content 등

scalar data sets 을 나타내는 일반 방법으로는 그래프나 차트를 이용하여 시간이나 위치를 인수로 하는 함수로 데이터 값의 분포를 나타냄

contour plots 을 이용하여 면에 분포되어 있는 data set 의 isolines(lines of constant scalar value) 를 디스플레이

Page 72: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 72

3 차원 scalar data fields 를 위해선 , cross-sectional slices 를 취해서 slice 의 2D data distributions 을 디스플레이

함 ( 그림 8-128) isosurfaces: 3D contour plots ( 그림 8-129)

volume rendering X-ray picture 와 비슷한 방법으로 3D data set 을 가시화하는 방법 data set 의 내부 정보가 ray-casting method 를 이용하여 디스플레이

스크린에 투영됨 각 스크린 픽셀로부터의 ray path 를 따라 interior data value 가 조사되고

디스플레이를 위해 인코딩됨 ( 그림 8-131)

Page 73: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 73

벡터 필드 (Vector field) 의 시각적 표현 3D 공간의 벡터 양 V 는 세 스칼라 값 (Vx, Vy, Vz) 을 가짐 다른 표현으로는 크기 |V| 와 방향을 나타내는 unit vector, u 로 나타냄 스칼라와 마찬가지로 벡터 양은 시간 , 위치 , 혹은 다른 파라미터의

함수로 나타낼 수 있음 예 : velocity, acceleration, force, electric fields, magnetic fields, ... 벡터필드를 가시화하는 방법으로는

점을 찍은 후 작은 화살표로 방향을 나타냄 ( 그림 8-133) field lines or streamlines 등 이용 : ( 그림 8-134) 그 외 Tensor fields 혹은 Multivariate data fields 로 나타내는 방법이 있음

Page 74: Chapter 8. Three-Dimensional Object Representations

2009-1 학기Chapter 8. Three-Dimensional Object

Representations 74