Date: Mon, 16 Dec 1996 22:09:03 GMT
Server: NCSA/1.5
Content-type: text/html
Last-modified: Mon, 12 Feb 1996 13:43:12 GMT
Content-length: 6846
CS418 Lab 11
CS 418: Laboratory 11
Implicit Surfaces
Introduction.
In this lab you will investigate implicit surface generation. Implicit surfaces
are generated by finding "level surfaces" in a 3D field. That is, by
placing polygons in all of the voxels which have scalar data of a certain
value. The surface descriptions often take forms familar from analytical
geometry. For instance, a unit sphere at the origin is described by
x^2 + y^2 + z^2 - 1.0
when a surface is fit to the points in 3D which have a value of zero.
Procedure
Download:
The program heart.net takes as input an implicit function of x,y,z and
forms an surface. The function is calculated at grid points, then
polygonalized by isosurface rendering, assuming
an isosurface value of zero. For example the formula
(2*x^2 + y^2 + z^2 -1)^3 - 0.2*x^2*z^3 - y^2*z^3
creates a heart-shaped object.
Different functions of x,y,z will produce different shapes.
(Note that for different functions, you may
have to modify the range limits of the space defined by the Construct
module.) As an example, the following image was made by
defining an implicit sphere
in a separate module from the heart, then morphing between them by
linearly intropolating between the two 3D fields.
In this case, mixing .9 of the heart 3D field
with 0.1 of the sphere 3D field. The sphere used was:
x^2 + y^2 +(z+.25)^2 -.5

The program SurfaceCombine.net shows how to combine two implicit surfaces
to simulate the "union" operation as used in constructive solid
geometry (see page 35 of Watt). Three new macros are used in this program;
InitCSG, UnionCSG, and MakeCSGsurface. You can inspect (or modify) the
macros using the "Open Selected Macro" option in the "Windows" menu of the
visual program editor.
The two cylinder surfaces are combined (in the UnionCSG macro)
using a min(a,b)
function so that the voxels which are in the
interior of either cylinder are interior to the result. (Remember that
an implicit function changes sign as the surface is crossed and that for
the surfaces used here, that points inside have a negative value.) The
image below is the result of the union of two cylinders.
The program blobby.net computes an implicit surface based on spherical
fields of influence which can add together. See one of last year's
student
projects for more information on blobby functions. The spherical
fields can have positive and negative field strengths. An example from
blobby.net shows four positive spheres (transparent red) and two negative
spheres (blue) which when summed together, then passed thorough an
isosurface module produce the object shown to the right.
Assignment:
Execute the programs to understand their behavior, then modify them as
follows:
- Modify heart.net to generate a torus from an implicit function of
(x,y,z). You will need to construct a function
which is negative if the position (x,y,z) is within a certain distance
of a circle and positive otherwise. Include interactors to set the
radius of the torus and the radius of its cross-section.
- Extend SurfaceCombine.net to perform the CSG operations of intersection
and subtraction by writing two new macros called IntersectCSG and SubCSG.
Provide interactors for choosing any combination of two spheres, cylinders, tori,
or cones. Provide interactors for performing a union,
intersection, or subtraction of the two selected shapes. That is, your
program should be able to, for example, select a sphere and a cone, and
form the subtraction of cone-minus-sphere or sphere-minus-cone or union the sphere
and the cone or intersect the sphere and the cone. Shown below are the
intersection of two cylinders and one cylinder "minus" the other.
The image below is formed as
((superquadric minus torus) union cylinder),
but with about 1% white noise added to the 3D field.
- Use the interactors in blobby.net to make a human head with
recognizable (but not necessarily artistic) eyes, nose, mouth and
ears.
- Modify blobbyMacroUI.net to
produce two separate groups of blobs (with separate interactor inputs)
which can be combined using your CSG modules. You will need to modify
blobby.macro.net to output a 3D field rather than a surface. Show one
example of to separate blob groups combined with CSG operations.
Be prepared to demo the programs to show the torus generator, the CSG
operations, the head you designed, and the grouped blobby program. The
grader will exercise all interactors.
You should be able to explain your programs. You should use
transmitters/receivers, macros, and comments
in the "Notation" field of each module
so that you and the grader can understand the program.
Control panels, if any,
should be well organized, labeled, and with the appropriate numeric ranges.
The
Lab 11 grading guide
will be filled out by a consultant during section to evaluate your work.
Back to Main Page
Last modified, 10/20/95, B. Land.
Copyright Statement