Sunteți pe pagina 1din 14

'

Curved Surfaces Sweep Representations Constructive Geometry Bezier Curves

&

'

Sweep representations

Sweep representations are used to construct 3D objects that have some kind of symmetry. For example, a prism can be generated using a translational sweep Rotational sweeps can be used to create curved surfaces like an ellipsoid or a torus In both cases, you start with a cross-section and generate more vertices by applying the appropriate transformation. More complex objects can be formed by using more complex transformations. Also, you can dene a path for a sweep that allows you to create more interesting shapes.

&

'

Translational Sweep

&

'

Rotational Sweep

&

'

Constructive Solid Geometry

Another approach to object modeling consists of using set operations to combine two objects. Union Intersection Dierence Generally start with a set of primitives that serve as building blocks. Ray casting is a method used for determining boundaries of the resulting object if you start with a boundary representation. Octree representations are designed to make this process easier.

&

'

Constructive Geometry Example

Figure b is the intersection of the original solids Figure c is the dierence between the two original solids & %

'

Ray Casting

Operation Union Intersection Dierence (obj2 obj1 )

Surface Limits A, D C, B B, D

&

'

Quadtree and Octree Representations

The basic idea is to divide space up into homogeneous regions. Use a tree structure with large regions near the root If a region is uniform, store its properties If a region is non-uniform, subdivide it and repeat the process

&

'

Curves

Curves are used in graphics for a number of purposes to represent surfaces (usually tessellated) to represent paths for motion Splines approximate curves with a series of polynomial segments There are a number of common approaches Bezier curves Cubic splines B-Splines Rational splines

&

'

Bezier Curves

The basic idea of a Bezier curve is to generate a curve between two end points by determining the coecients of a polynomial of the appropriate degree from the end points and an appropriate number of control points. The discussion below is for third order Bezier curves which require 2 control points

&

'

Geometric Algorithm for Bezier curves

P1 A P0

P2 B P3

A1 C1 B1

Start with endpoints and two control points nd midpoints of lines joining these points nd midpoint of lines joining points generated in 2 nd midpoint of line joining points generated in 3 Recursively apply algorithm to two new sets of points until segments are short enough to make a smooth curve & %

'

Parametric Curves

A curve can be represented as a set of functions that represent x and y values as a function of some parameter, t the parametric representation of a circle is

x(t) y (t)

= r cos t = r sin t

each value of t generates one point on the curve

&

'

Parametric representation of Bezier curves


For a third-order Bezier curve, we can represent the curve as x B(t) = = (1 t)3 P0 + t(1 t)2 P0 + t2 (1 t)P2 + t3 P3 y B(t) = P0 and B(t) = P3 so we have a cubic curve which goes through P0 and P3 . The vectors P0 P1 and P2 P3 are tangent to the curve at the endpoints.
P1 A P0 C P2 B P3

A1 C1 B1

This property of the tangents guarantees that the recursively generated curve is smooth & %

'

Curved Surfaces

The same algorithms can be used for curves in three dimensions just add z-coordinates to the equations

&

S-ar putea să vă placă și