Copyright @ 2003 by Jim X. Chen: [email protected]
1
Introduction to Modeling
Jim X. ChenGeorge Mason University
Copyright @ 2003 by Jim X. Chen: [email protected]
2
What is ModelingWhat is Modeling a process of constructing a virtual 3D
graphics object
Modeling tools: creating and constructing complex 3D models fast and easy.
Rendering is a process of creating images from graphics models.
Copyright @ 2003 by Jim X. Chen: [email protected]
3
A graphics modelA graphics model geometrical descriptions (particles, vertices,
polygons) and associated attributes (colors, shadings, transparencies, materials)
can be saved in a file using a standard (3D model) file format.
Copyright @ 2003 by Jim X. Chen: [email protected]
4
Models Organizational models: hierarchies representing institutional bureaucracies
Quantitative models: equations describing econometric, financial, socialogical, ... systems
Geometric models: collections of components with well-defined geometry and their interconnections
Deformable models: that change forms
Copyright @ 2003 by Jim X. Chen: [email protected]
6
POLYGON MESHESPOLYGON MESHES
• list of vertices - polygon; list of edges - polygon• list of polygons -- objects• Plane equation from 3 vertices: Ax + By +Cz + D = 0
• Normal: (A,B,C) = k(P1P2 x P1P2)
• A, B, and C are proportional to the signed areas of the projections of the polygon onto the (y, z), (x, z), and (x, y) planes. If the polygon is parallel to the (x, y) plane, then A = B = 0.
Copyright @ 2003 by Jim X. Chen: [email protected]
7
QUADRIC SURFACES
Quadric SurfacesThe implicit surface equation of the form
defines the family of quadric surfaces:
ax2+by2+cz2+2(dxy+eyz+fxz+gx,+hy+jz)+k=0
Sphere
x2+y2+z2=R2; or in parametric formx=rcoscos, y=rcossin, z=rsin
Ellipsoid
(x/a)2+(y/b)2+(z/c)2=1;or in parametric formx = a coscos, y = b cossin, z = c sin
Torus
[r-((x/a)2+(y/b)2)1/2]2+(z/c)2=1;orx = a(r+coscos, y = b(r+cossin, z = c sin
Copyright @ 2003 by Jim X. Chen: [email protected]
8
Superquadrics
supperellipse: x = a coss, y = b sins
supperellipsoid
x=rcosscost, y=rcosssint, z=rsins
Blobby ObjectsSome objects do not maintain a fixed shape, but
change their surface characteristics in certain motions or when in proximaity to other objects.
One way to model: combinations of Gaussian density functions, or “bumps”:
where T is a threshold
and a and b are to adjust the amount of blobbiness
Tebk
zyXak
kkkk 222
Copyright @ 2003 by Jim X. Chen: [email protected]
9
PARAMETRIC BICUBIC SURFACES
• General form of cubic curve: Q(u) = U ·M ·G where G, the geometry vector, is a constant • If we allow G to vary in 3D along some path:
Then, a functional description is often tesselated to produce a polygon-mesh approximation to the surface (trianglular polygon patches)
• For a fixed t1, Q(s, t1) is a curve because G(t1) is constant. If Gi(t) are cubics, the surface is said to be a parametric bicubic surface
)(
)(
)(
)(
)(),(
4
3
2
1
tG
tG
tG
tG
MStGMStsQ
Copyright @ 2003 by Jim X. Chen: [email protected]
10
Hermite Surfaces
x
h
R
R
P
P
Muuuux
4
1
4
1
23 1)(
0001
0100
1233
1122
hM
,
)(
)(
)(
)(
),(
4
1
4
1
x
h
tR
tR
tP
tP
MStsx
)1,0(
)0,0(
)1,0(
)0,0(
)(1
xt
t
x
x
MTtP hx
Curve: and
Surface:
THxhx GMTtRtRtPtP )()()()( 4141Since:
we have:
Copyright @ 2003 by Jim X. Chen: [email protected]
11
TThHxhh TMGMS
tR
tR
tP
tP
MStsx
)(
)(
)(
)(
),(
4
1
4
1
)1,1()0,1()1,1()0,1(
)1,0()0,0()1,0()0,0(
)1,1()0,1()1,1()0,1(
)1,0()0,0()1,0()0,0(
22
22
xts
xts
xs
xs
xts
xts
xs
xs
xt
xt
xx
xt
xt
xx
GHx
Where
Where x coordinates, coordinates of the tangent vectors and twists are specified
Copyright @ 2003 by Jim X. Chen: [email protected]
12
Just as the Hermite cubic curves, the Hermite bicubic permits C 1 and G1 continuity from one patch to the next
1st, to have C0 continuity, the matching curves of the two patches must be identical, which means the control points for the two surfaces must be identical along the edge
To have C1 continuity, the control points along the edge and the tangent and twist vectors across the edge be equal.
To have G1 continuity, the tangent and twist vectors across the edge be in the same direction, but do not need to have the same magnitude. .
Copyright @ 2003 by Jim X. Chen: [email protected]
13
Bezier Surfaces
The Bezier bicubic formulation can be derived in exactly the same way
as above. The results are:
B-Spline SurfacesThe B-Spline bicubic formulation can be derived in exactly the same
way also. The results are:
Normals to SurfacesThe cross product between the s and t tangent vectors of the surface Q(s, t) results in the normal at given s and t:
TTbBxb TMGMStsx ),(
TTBsBSxBs TMGMStsx ),(
),(),( tsQt
tsQs
Copyright @ 2003 by Jim X. Chen: [email protected]
14
Solid Modeling MethodsSolid Modeling Methods(Modeling Solids)(Modeling Solids)
Copyright @ 2003 by Jim X. Chen: [email protected]
15
Creating solid models.
A solid model is defined by volumes.
Hierarchy of entities from low to high: keypoints lines areas volumes.
You cannot delete an entity if a higher-order entity is attached to it.
Volumes
Areas
Lines &Keypoints
Keypoints
Lines
Areas
Volumes
Copyright @ 2003 by Jim X. Chen: [email protected]
16
File formats Representing Solids (solid models)
The domain of representation should be large to allow a useful set of physical objects (solids)
The representation should be unambiguous
Modeling Tools have their own file formats
Volumes
Areas
Lines &Keypoints
Keypoints
Lines
Areas
Volumes
Copyright @ 2003 by Jim X. Chen: [email protected]
17
Simple 3D Half-Spaces Sphere Cylinder Cone Torus Box Plane
it splits space into two infinite half-spaces you can use an infinite cylinder and two planes to make a
capped cylinder You can also get a box from 6 planes…
Copyright @ 2003 by Jim X. Chen: [email protected]
18
Modeling Approaches
Two approaches to creating a solid model: Top-down Bottom-up
Top-down modeling starts with a definition of volumes (or areas), which are then combined in some fashion to create the final shape.
add
Copyright @ 2003 by Jim X. Chen: [email protected]
19
Approaches Bottom-up modeling starts with keypoints, from which
you “build up” lines, areas, etc.
You may combine both methods.
Copyright @ 2003 by Jim X. Chen: [email protected]
20
Top-Down Modeling Top-down modeling starts with a
definition of volumes (or areas), which are then combined in some fashion to create the final shape. The volumes or areas that you initially
define are called primitives. Primitives are located and oriented with the
help of the working plane. The combinations used to produce the final
shape are called Boolean operations.
Copyright @ 2003 by Jim X. Chen: [email protected]
21
Primitives 2-D primitives include rectangles,
circles, triangles, and other polygons.
Copyright @ 2003 by Jim X. Chen: [email protected]
22
Primitives 3-D primitives: blocks, cylinders,
prisms, spheres, and cones.
Copyright @ 2003 by Jim X. Chen: [email protected]
23
Top-Down Modeling
...Primitives When you create a 2-D primitive, a modeling tool
usually defines an area, along with its underlying lines and keypoints.
When you create a 3-D primitive, a modeling tool usually defines a volume, along with its underlying areas, lines and keypoints.
Copyright @ 2003 by Jim X. Chen: [email protected]
24
Top-Down Modeling
...Primitives You can create primitives by specifying
their dimensions or by picking locations in the graphics window.
Copyright @ 2003 by Jim X. Chen: [email protected]
25
Top-Down Modeling
Boolean Operations Boolean operations: combinations of geometric
entities: add, subtract, intersect, divide, glue, and overlap, etc.
The “input” to Boolean operations: geometric entities, simple primitives or complicated volumes imported from a CAD system.
add
Input entities Boolean operation Output entity(ies)
Copyright @ 2003 by Jim X. Chen: [email protected]
26
Boolean CSG Operations Union
Addition, A B
Intersection A B
Difference Subtraction, A – B, A not B Difference is not commutative
Copyright @ 2003 by Jim X. Chen: [email protected]
27
A more complicated example Difference of:
Intersection of Sphere and Cube Union of 3 Cylinders
- =
Copyright @ 2003 by Jim X. Chen: [email protected]
28
Bottom-Up Modeling
Most modeling tools use top-down approach Low level programming systems usually
adopts with bottom-up modeling
Copyright @ 2003 by Jim X. Chen: [email protected]
29
Primitive Instancing In a hierachical model, there are parts that are exactly
the same.
For example, all four wheels of a car can be the same model.
Instead of saving four copies of the model, we save just one primitive model and three instances
If we modify the primitive, we know that the primitive and the instances are identically changed.
Copyright @ 2003 by Jim X. Chen: [email protected]
30
Sweep Representations a 2D area swept along a linear path
normal to the plane of the area to create a volume
2D/3D along a trajectory through space defines a new object -- sweep
Copyright @ 2003 by Jim X. Chen: [email protected]
31
More representations Boundary Representations
describe object by its surface boundaries: shared edges have pointers to 2 polygons, etc.
Spatial-partitioning representations
Spatial-Occupancy Enumeration
identical solids called voxels (volume elements) arranged in a fixed regular grid.
Octrees: divide-&-conquer power of subdivision.
Binary Space-partitioning Trees: recursively divide space into pairs of subspaces, each separated by a plane. Originally used in determining visible surfaces in graphics.
Copyright @ 2003 by Jim X. Chen: [email protected]
32
Physics-based Modeling Modeling triangular polyhedron: all
vertices and the surrounding triangular shapes are congruent
Copyright @ 2003 by Jim X. Chen: [email protected]
33
Modeling Tools http://www.cs.gmu.edu/~jchen/graphi
cs Examples in 3D Studio MAX 3, the
book