Solid Modeling CS418 Computer Graphics John C. Hart Implicit - - PowerPoint PPT Presentation

solid modeling
SMART_READER_LITE
LIVE PREVIEW

Solid Modeling CS418 Computer Graphics John C. Hart Implicit - - PowerPoint PPT Presentation

Solid Modeling CS418 Computer Graphics John C. Hart Implicit Surfaces f =0 f < 0 1 f > 0 (0,0) Real function f ( x , y , z ) Classifies points in space Image synthesis (sometimes) Circle example f ( x , y ) = x 2 + y 2


slide-1
SLIDE 1

Solid Modeling

CS418 Computer Graphics John C. Hart

slide-2
SLIDE 2

Implicit Surfaces

  • Real function f (x,y,z)
  • Classifies points in space
  • Image synthesis (sometimes)

– inside f > 0 – outside f < 0 – on the surface f = 0

  • CAGD: inside f < 0, outside f > 0

f < 0 f > 0 f = 0 f < 0 f > 0 f = 0

Circle example f(x,y) = x2 + y2 – 1

(0,0) 1 f=0

z = f(x,y)

f > 0 f < 0

slide-3
SLIDE 3

Why Use Implicits?

  • v. polygons

– smoother – compact, fewer higher-level primitives – harder to display in real time

  • v. parametric patches

– easier to blend – no topology problems – lower degree – harder to parameterize – easier to ray trace – well defined interior

slide-4
SLIDE 4

Surface Normals

  • Surface normal is parallel to the

function gradient ∇f(x,y,z) = (δf/δx, δf/δy, δf/δz)

  • Gradient not necessarily unit length

n = ∇f (x,y,z)/||∇f (x,y,z)||

  • Gradient points in direction of

increasing f – Outward when f < 0 denotes interior – Inward when f > 0 denotes interior

Circle example f (x,y) = x2 + y2 – 1 ∇f (x,y) = (2x, 2y)

(0,0) 1 f(x,y)=0

z = f(x,y)

f > 0 f < 0

∇f (x,y)

slide-5
SLIDE 5

Smoothness

  • Surface f -1(0) is a smooth

“manifold” if zero is a “regular” value of f

  • Surface is “manifold” if the

infinitesimal neighborhood around any point can be deformed into a simple flat region

  • Zero is a “regular” value means

that at any point (x,y,z) where f(x,y,z) = 0, then ∇f(x,y,z) ≠ (0,0,0) ∇f(x,y,z) = (0,0,0) ∇f(x,y,z) ≠ (0,0,0) ∇f(x,y,z) ≠ (0,0,0)

slide-6
SLIDE 6

Plane

  • Plane bounds half-space
  • Specify plane with point p and

normal N

  • Points in plane x are perp. to

normal N

  • f is distance if ||N|| = 1

N p x x f(x) = (x-p)⋅N f < 0 f > 0

slide-7
SLIDE 7

Quadrics

f (x,y,z) = Ax2 + 2Bxy + 2Cxz + 2Dx + Ey2 + 2Fyz + 2Gy + Hz2 + 2Iz + J x z y

slide-8
SLIDE 8

Quadrics

f (x,y,z) = Ax2 + 2Bxy + 2Cxz + 2Dx + Ey2 + 2Fyz + 2Gy + Hz2 + 2Iz + J

  • Sphere:

x2 + y2 + z2 – 1 = 0 x z y

slide-9
SLIDE 9

Quadrics

f (x,y,z) = Ax2 + 2Bxy + 2Cxz + 2Dx + Ey2 + 2Fyz + 2Gy + Hz2 + 2Iz + J

  • Sphere:

x2 + y2 + z2 – 1 = 0

  • Cylinder:

x2 + y2 – 1 = 0 x z y

slide-10
SLIDE 10

Quadrics

f (x,y,z) = Ax2 + 2Bxy + 2Cxz + 2Dx + Ey2 + 2Fyz + 2Gy + Hz2 + 2Iz + J

  • Sphere:

x2 + y2 + z2 – 1 = 0

  • Cylinder:

x2 + y2 – 1 = 0

  • Cone:

x2 + y2 – z2 = 0 x z y

slide-11
SLIDE 11

Quadrics

f (x,y,z) = Ax2 + 2Bxy + 2Cxz + 2Dx + Ey2 + 2Fyz + 2Gy + Hz2 + 2Iz + J

  • Sphere:

x2 + y2 + z2 – 1 = 0

  • Cylinder:

x2 + y2 – 1 = 0

  • Cone:

x2 + y2 – z2 = 0

  • Paraboloid: x2 + y2 – z = 0

x z y

slide-12
SLIDE 12

Homogeneous Quadrics

f (x,y,z) = Ax2 + 2Bxy + 2Cxz + 2Dx + Ey2 + 2Fyz + 2Gy + Hz2 + 2Iz + J

[ ]

                        = 1 1 ) , , ( z y x J I G D I H F C G F E B D C B A z y x z y x f

f(x) = xT Q x

slide-13
SLIDE 13

Transforming Quadrics

  • Given a quadric Q with implicit surface xT Q x = 0
  • What is the matrix Q’ of the quadric transformed by M

x z y x z y xT Q x = 0 xT Q’ x = 0

slide-14
SLIDE 14

Transforming Quadrics

  • Given a quadric Q with implicit surface xT Q x = 0
  • What is the matrix Q’ of the quadric transformed by M
  • Let x’ = M x
  • Find Q’ such that x’T Q’ x’ = 0

x z y x z y xT Q x = 0 x’T Q’ x’ = 0 M

slide-15
SLIDE 15

Transforming Quadrics

  • Given a quadric Q with implicit surface xT Q x = 0
  • What is the matrix Q’ of the quadric transformed by M
  • Let x’ = M x
  • Find Q’ such that x’T Q’ x’ = 0
  • Since x = M -1 x’ we have

(M -1 x’)T Q (M -1 x’) = 0 x’T (M -1)T Q M -1 x’ = 0

  • So Q’ = (M -1)T Q M -1
slide-16
SLIDE 16

Transforming Quadrics

  • Given a quadric Q with implicit surface xT Q x = 0
  • What is the matrix Q’ of the quadric transformed by M
  • Let x’ = M x
  • Find Q’ such that x’T Q’ x’ = 0
  • Since x = M -1 x’ we have

(M -1 x’)T Q (M -1 x’) = 0 x’T (M -1)T Q M -1 x’ = 0

  • So Q’ = (M -1)T Q M -1

(Since x is homogeneous, and we’re evaluating xT Q x = 0 we don’t care about scale, so we can use the easier-to-compute adjoint M* instead of the inverse M-1.)

slide-17
SLIDE 17

Torus

  • Product of two implicit circles

(x – R)2 + z2 – r2 = 0 (x + R)2 + z2 – r2 = 0 ((x – R)2 + z2 – r2)((x + R)2 + z2 – r2) (x2 – Rx + R2 + z2 – r2) (x2 + Rx + R2 + z2 – r2) x4+2x2z2+z4 – 2x2r2–2z2r2+r4 + 2x2R2+2z2R2–2r2R2+R4 (x2 + z2 – r2 – R2)2 + 4z2R2 – 4r2R2

  • Surface of rotation

replace x2 with x2 + y2 f(x,y,z) = (x2 + y2 + z2 – r2 – R2)2 + 4R2(z2 – r2)

R r

slide-18
SLIDE 18

Constructive Solid Geometry

  • Let shape F be implicitly defined by f(x)
  • Let shape G be implicitly defined by g(x)

f < 0 g < 0 f < 0 g < 0

F G

slide-19
SLIDE 19

Constructive Solid Geometry

  • Let shape F be implicitly defined by f(x)
  • Let shape G be implicitly defined by g(x)
  • The union H = F ∪ G is defined by

h(x) = min f(x), g(x)

f < 0 g < 0 f < 0 g < 0

F G H = F ∪ G

slide-20
SLIDE 20

Constructive Solid Geometry

  • Let shape F be implicitly defined by f(x)
  • Let shape G be implicitly defined by g(x)
  • The union H = F ∪ G is defined by

h(x) = min f(x), g(x)

  • The intersection H = F ∩ G is defined by

h(x) = max f(x), g(x)

f < 0 g < 0 f < 0 g < 0

F G H = F ∩ G

slide-21
SLIDE 21

Constructive Solid Geometry

  • Let shape F be implicitly defined by f(x)
  • Let shape G be implicitly defined by g(x)
  • The union H = F ∪ G is defined by

h(x) = min f(x), g(x)

  • The intersection H = F ∩ G is defined by

h(x) = max f(x), g(x)

  • The difference H = F – G is defined by

h(x) = max f(x), -g(x)

f < 0 g < 0 f < 0 g < 0

F G H = F – G

slide-22
SLIDE 22

Blobs

  • Gaussian e-r²
  • Radius function

r² (x) = (x – c)⋅(x – c)

  • Gaussian sphere

f(x)= -T + e-r²(x)

  • For this formulation of implicit surfaces,

function is positive inside the object

slide-23
SLIDE 23
  • Union of spheres

f(x)= -T + min e-r1²(x), e-r2²(x)

Blobs

slide-24
SLIDE 24
  • Union of spheres

f(x)= -T + min e-r1²(x), e-r2²(x)

Blobs

slide-25
SLIDE 25
  • Union of spheres

f(x)= -T + min e-r1²(x), e-r2²(x)

  • Blended union of spheres

f(x)= -T + e-r1²(x) + e-r2²(x)

Blobs

slide-26
SLIDE 26
  • Union of spheres

f(x)= -T + min e-r1²(x), e-r2²(x)

  • Blended union of spheres

f(x)= -T + e-r1²(x) + e-r2²(x)

Blobs