Q: What is supposed to happen when the
spline gets to the left of the y axis? A: First of all, this is really an illegal
input; the point is for the surface to be defined by
a positive radius that is a function of height. But
if you'd like to have a sensible behavior under all conditions,
read on. When the spline is in +x territory, you
should be computing normals that face away from the axis
when the spline is headed in the +y direction, and you
should be constructing the mesh so that it is oriented facing away
from the axis. When the spline is on the left but still moving
upwards, if you don't do anything special about crossing
the axis, your triangles will still be oriented facing outward
but the normals will be facing inward. This results in wrong
shading on the surface. In
order for the surface to make sense on both sides of the axis,
you would need to reverse the normals when the radius is
negative. This would cause triangles that cross the axis to
have inconsitent normals, leading to artifacts—the only
right way out of this would be to locate all the zero-crossings
of the x component of the spline and ensure that you
generate points there.
Q: How should my surfaces look when they are
oriented correctly and have the correct normals?
A: The orientation of the triangles
determines what "material" (i.e. which set of shading paramters) is
used to draw the surface. The normals
control what the shading looks like: if they are correct and
facing the outside of the mesh (as determined by the triangle
orientation) the shading will be correct. Here are
examples of how the framework will shade
the outside
and inside of a mesh with
correct
normals and the outside and
inside of a mesh with backward
normals. A sphere (which faces outward and has outward-facing
normals) is shown for comparison.
Q: Why are there two copies of the framework
in model-fmwk.zip? A: By mistake. They
are identical; just use the one in the model
directory, or download again to get just one copy.
Q: Why won't the framework compile under my
64-bit operating system? A: Because the
libraries we provide are compiled for 32-bit, which is the mode
in use in the lab. You can probably get it to work by
downloading the proper compile of the Jogl library and making a
few changes to the framework. If you get this to work, let us
know how it went and we'll post some more specifics.
Remarks on setting up the framework
Your Eclipse project should be laid out as follows:
<project root>
src/
dlls/
jars/
icons/
Make a Run configuration for MainFrame
Under the Run... menu, go to the Arguments tab.
In the VM Arguments pane, put the following:
-Djava.library.path=./dlls/
This tells java how to find the OpenGL dlls it needs to run the program.