1 / 74

Chapter 8. Three-Dimensional Object Representations

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

ian-chavez
Télécharger la présentation

Chapter 8. Three-Dimensional Object Representations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 8. Three-Dimensional Object Representations Chapter 8. Three-Dimensional Object Representations

  2. Solid 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이 대표적 Chapter 8. Three-Dimensional Object Representations

  3. OpenGL Polyhedron Functions • OpenGL Regular Polyhedron Functions • glutWireTetrahedron ( ); // 4면체 • glutSolidTetrahedron ( ); • glutWireCube (edgeLength); • glutSolidCube (edgeLength); • glutWireOctahedron ( ); • glutSolidOctahedron ( ); • glutWireDodecahedron ( ); // 12면체 • glutSolidDodecahedron ( ); • glutWireIcosahedron ( ); • glutSolidIcosahedron ( ); Chapter 8. Three-Dimensional Object Representations

  4. 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 Chapter 8. Three-Dimensional Object Representations

  5. Parametric Coordinate position Z P = (x, y, z) r f Y q X 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을 어떤 축을 중심으로 회전시켰을 때 생김 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 Chapter 8. Three-Dimensional Object Representations

  8. Superquadrics • superquadrics: quadric representation을 일반화시킨 것 • quadric equations에 파라미터를 추가시켜서 object shape를 조정하기 위한 flexibility를 제공함 • 추가되는 파라미터는 object dimension을 나타냄 • curve에 대해선 one parameter • surface에 대해선 two parameters Chapter 8. Three-Dimensional Object Representations

  9. Superellipse • x, y 항에 대한 지수를 변형시킴 • (x/rx)2/s + (y/ry)2/s = 1 • 파라미터 s는 real value • superellipse에 대한 parametric equations • x = rxcoss • y = rysins • (그림8-6) Chapter 8. Three-Dimensional Object Representations

  10. 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 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); Chapter 8. Three-Dimensional Object Representations

  12. GLU Quadric-Surface Functions • GLUquadricobj *sphere1; • gluSphere (sphere1, r, nLongitudes, nLatitudes); • 기타 책 참고 Chapter 8. Three-Dimensional Object Representations

  13. blobby 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를 조정하기 위한 파라미터 Chapter 8. Three-Dimensional Object Representations

  14. Spline 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는 다음의 두 가지 방법으로 정의됨 Chapter 8. Three-Dimensional Object Representations

  15. 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를 의미 Chapter 8. Three-Dimensional Object Representations

  16. A set of control points approximated with piecewise continuous polynomial sections A set of points interpolated with piecewise continuous polynomial sections Chapter 8. Three-Dimensional Object Representations

  17. Parametric 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값이 같음 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) Chapter 8. Three-Dimensional Object Representations

  19. (b) (a) • zero-order continuity • first-order continuity • (c) second-order continuity (c) Chapter 8. Three-Dimensional Object Representations

  20. Geometric 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) Chapter 8. Three-Dimensional Object Representations

  21. C3 C2 p1 p2 p2 p1 p0 C1 C1 (a) (b) Three control points with two curve sections with (a) parametric continuity and (b) geometric continuity Chapter 8. Three-Dimensional Object Representations

  22. Spline specifications • a spline section에서 x coordinate가 다음의 식으로 나타내진다고 가정 • x(u) = axu3 + 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를 구할 수 있음 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 Chapter 8. Three-Dimensional Object Representations

  24. Cubic 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 + bxu2 + cxu + dx • y(u) = ayu3 + byu2 + cyu + dy • z(u) = azu3 + bzu2 + czu + dz Chapter 8. Three-Dimensional Object Representations

  25. pn p1 p2 p0 A piecewise continuous cubic-spline interpolation of n+1 control points Chapter 8. Three-Dimensional Object Representations

  26. Natural 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이 얻어짐 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을 허용하지 않음 Chapter 8. Three-Dimensional Object Representations

  28. Hermite 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) 값을 지정함 Chapter 8. Three-Dimensional Object Representations

  29. pk P(u) = (x(u), y(u), z(u)) Pk+1 Parametric point function P(u) for a Hermite curve section 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 + bxu2 + cxu + dx y-component는 y(u) = ayu3 + byu2 + cyu + dy z-component는 z(u) = azu3 + bzu2 + czu + dz • P(u), P’(u)를 matrix form으로 나타내면 a P(u) = [u3 u2 u 1] b c d 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 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 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 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이라고 함 Chapter 8. Three-Dimensional Object Representations

  35. 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) 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 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) Chapter 8. Three-Dimensional Object Representations

  38. Bezier 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! 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) Chapter 8. Three-Dimensional Object Representations

  40. Properties 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}에서 구해짐 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 내에 존재한다. Chapter 8. Three-Dimensional Object Representations

  42. Cubic 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이다. Chapter 8. Three-Dimensional Object Representations

  43. BEZ0,3(u) BEZ1,3(u) 1 1 1 1 BEZ2,3(u) BEZ3,3(u) 1 1 The four blending functions for cubic curves (n=3) 1 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를 이용 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 Chapter 8. Three-Dimensional Object Representations

  46. Bezier 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의 위치를 지정함 Chapter 8. Three-Dimensional Object Representations

  47. B-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를 정의하여 얻어짐 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라고 함 Chapter 8. Three-Dimensional Object Representations

  49. 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에 영향을 미친다. Chapter 8. Three-Dimensional Object Representations

  50. Fig.8-42 Periodic blending functions for n=d=3 and a uniform, integer knot vector B0,3(u) B1,3(u) 1 1 1 2 3 4 5 6 B2,3(u) B3,3(u) 1 1 Chapter 8. Three-Dimensional Object Representations

More Related