CS465 Program 2: Model
- Q: What version of JOGL does this use?
A: The framework code is based on previous years,
and uses an older version of JOGL from the
net.java.games.jogl package. All necessary jars and binaries are
included in the framework. Feel free to use a newer JOGL version
if you'd like, but it shouldn't be necessary.
- 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
- 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
of a mesh with correct normals and the outside
of a mesh with backward normals. A sphere (which faces outward and has
outward-facing normals) is shown for comparison.
- 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.