3D Polygons - UCRvbz/cs130f14-06.pdf2 3 • To do this, we can project the 3D polygon into 2D and...

Post on 30-Jun-2018

213 views 0 download

Transcript of 3D Polygons - UCRvbz/cs130f14-06.pdf2 3 • To do this, we can project the 3D polygon into 2D and...

1

1

Surface and SolidGeometry

2

• Once we know our plane equation:

Ax + By + Cz + D = 0,

we still need to manage the truncation which leads to the polygon itself

Functionally, we will need to

do this to know if a point

lies in a polygon or not,

for example

3D Polygons

2

3

• To do this, we can project the 3D polygon into 2D and see if the point is in the 2d

using the inside test

(xi,yi,zi)

(xi’,yi’)

z

x

y

3D Polygons

4

•Project 3d to 2d based on largest of A,B,C

(xi,yi,zi)

(xi’,yi’)

z

x

y

This example:

Z (or C) is principal component of N, normal so project on to xy-plane

3D Polygons

3

5

Z-buffer

•For 3D with multiple polygons, must deal with visibility

imageplane

Project vertices into image plane and with projected vertex include depth in additional depth- or Z-buffer

6

Z-buffer

Scan convert each projected polygon:

For each polygon in scene

project verticies

for each pixel inside poly

calculate z

if z < closest

draw into frame buffer

update z buffer

4

7

Z-buffer

•How do we calculate z for buffer, quickly?

z = (-Ax -By -D)/C from plane eq.

Same scanline (x + 1):

z' = (-A(x + 1) - By - D)/C or

z' = z - A/C

z z'

8

Z-buffer

•How do we calculate z for buffer, quickly?

•For the next scanline, following edge coherence:

xs+1 = xs + 1/m, ys+1 = ys +1

plus zs = (-Axs -Bys -D)/C,

zs+1 = zs - (A/m + B)/C

z z'

zs+1

5

9

Z-buffer

•Z-buffering is very common approach, also often accelerated with hardware

•OpenGL embeds this approach

3D Polygon Image PixelsGRAPHICS PIPELINE

10

6

11

Surface Geometry

12

Surfaces

• Interpolating points for 2 parameters, u and v

Bi-cubic patch

7

Subdivision Surfaces

Refinement

Types of Subdivision

• Interpolating Schemes- Limit Surfaces/Curve will pass through original set

of data points.

•Approximating Schemes- Limit Surface will not necessarily pass through the

original set of data points.

8

Subdivision Surfaces

• Approach Limit Curve Surface through an Iterative Refinement Process.

Refinement 1 Refinement 2

Refinement ∞

Interpolation example

A Primer: Chaiken’s Algorithm (approximating surface)

213

212

4

1

4

34

3

4

1

PPQ

PPQ

325

324

4

1

4

34

3

4

1

PPQ

PPQ

101

100

4

1

4

34

3

4

1

PPQ

PPQ

Apply Iteratively

Limit ‘Curve’ Surface

P0

P1

P2

P3

Q0

Q1

Q2Q3

Q4

Q5

Subdivision Surfaces

9

Surface Example

Surface evolution with subdivision level

Limit surface

Catmull-Clark Subdivision (1978)

n

ivn

f1

1FACE

42121 ffvv

e

EDGE

VERTEX

j

jj

jii fn

en

vn

nv

221

112

10

Subdivision used in production

• Traditionally B-spline patches have been used in production for character animation.

• Difficult to control B-spline patch density in character modelling.

Subdivision in Character AnimationTony Derose, Michael Kass, Tien Troung(SIGGRAPH ’98)

(Geri’s Game, Pixar 1998)

Solid ConstructiveGeometry

11

21

• Inherently 3D, geometric elements describe sets of spaces enclosed by 2D boundaries

•For example, a solid sphere is the simplest solid element. Other simple primitives include the cube, cylinder, cone, and torus

Solid geometry

22

•Other objects are defined by combinations of primitives.

•An entire math has been explored related to the combination of solid primitives called constructive solid geometry (CSG)

•With CSG, complex shapes may be generated from operations formed on primitives

Solid geometry

12

23

•Boolean operators are defined tools for combining solid geometry for CSG

•These perform group operations on the points included in the solid primitives

•They are: - Union

- Subtraction

- Intersection

•These bool-op's are implemented in Maya

Solid geometry

24

•Boolean operator: Union combines two elements into a single one

Solid geometry

13

25

•Boolean operator: Union combines two elements into a single one

Solid geometry

26

•Boolean operator: Subtract take the difference between two elements

Solid geometry

14

27

•Boolean operator: Subtract take the difference between two elements

Solid geometry

28

•Boolean operator: Subtract take the difference between two elements

Solid geometry

15

29

•Boolean operator: Subtract

Solid geometry

30

•Boolean operator: Intersection finds the common points in the given primitives

Solid geometry

16

31

32

Solid ConstructiveGeometry

17

33

Solid geometryCSGTree

Graph for hierarchyof Booleanoperations

Often usedfor CAD andMech Eng

34

Solid geometry

Adams & Dutre 2003

18

35

Surfaces splitting

Split along the intersection curve

Label each part of the object (inside/outside)

A∩B

A A C A

A C ACA

36

Example

19

37

Intersection curve

Compute approximate intersection of both mesh sets

38

Split and label operations

Interior faces

Exterior faces

20

39

Intersection Union A - B B - A

Reconstruction

Depending on boolean operation: Mergeoperation along the intersection curve

40

WHY?Solid Constructive

Geometry

21

41

Solid ConstructiveGeometry

42

Solid ConstructiveGeometry