CS465 Program 3: Pipeline
FAQ
- 1:15 pm, 16 October 2004: My Triangle scene still doesn't match
the OpenGL window in a lot of cases.
A: Yes, we know. If your other
scenes match then you are fine. The Triangle scene was included as a way for you to
debug your transformation of the vertices (since having only 3 vertices makes life
easier).
- 12:30 pm, 16 October 2004: I get weird artifacts in the Triangle
and Maze scenes. They look like little speckles all over the place.
A:
These are due to the fact that we have often put two triangles right on top of each other
with opposite normals, to give the effect of a two sided polygon. To handle this, do
backface culling. We recommend you do it in the rasterizer.
- 12:30 pm, 16 Ocotber 2004: How do I transform the normals? I can't
find an "inverse" or a "transpose" operation anywhere in the provided matrix class!
A: Well, the only kind of transformations we allow you to do are rotations
and translations. As a result, the inverse of the transpose of the modelview matrix is
actually rather easy to compute from the modelview matrix...
- 12:30 pm, 16 October 2004: How do we get a reference to the
appropriate transformation matrices, lighting model information, etc. within our TP and
FP classes?
A: Use the updateLightModel
and
updateTransforms
to cache any information you think is necessary. These will be
called by the framework whenever the appropriate information is changed.
- 12:30 pm, 16 October 2004: The Triangle scene doesn't seem to have
a texture set, and its causing my fragment shader to crash.
A: Add
the line pipeline.setTexture(texture);
at the beginning of the function
render(Pipeline)
in the SceneTriangle
class.
- 5:30 pm, 7 October 2004: The clipping for the software doesn't match the
clipping for OpenGL.
A: Grab the new version of the code. I fixed the bug
in the clipper.
- 12:01 am, 7 October 2004: I think the vecmath library is buggy, my calls
aren't working right.
A: Read the documentation closely! I cannot stress
how important this is. The vecmath calling convention differs greatly from the rest of the
Java language, and methods don't often do what you expect them to do!
Setup Information
This project will involve a little setup on your part, since it invovles OpenGL. Before anything
else, it helps if you know which version of the JRE your machine is using and where it is
installed. On windows, all JREs are installed to C:\Program Files\Java\. On linux, the JDK and
JRE are installed to the same location: /usr/java/. If you are using ecipse, it is simple to
figure out which JRE you are using and place the JAR files only where you need them. Go to
"Window->Preferences->Installed JREs" and determine the location of the default JRE for
eclipse. Note that JDKs come with a version of the JRE as well. It usually resides in a
subdirectory of the JDK called, amazingly enough, jre.
The way the JRE works is it assumes all JAR files in its \lib\ext directory are to be added to the
classpath. So if you can copy the JAR files there, then great. Otherwise, you have to manually
change your classpath or add the JAR files into your project externally. The native code (DLLs
on Windows, SO files on Linux, etc) is placed in different locations depending on the system. The
locations that are valid depend on a Java property called "java.library.path", which can be
determined for any system by printing out the result of System.getProperty("java.library.path")
.
|
Windows |
Linux |
Full Access |
- Make sure you have the latest drivers for your video card.
- Download the windows libraries
- Place the JAR files in the \lib\ext subdirectory of your default JRE. If you aren't sure
which JRE you are using, copy the JAR files to C:\Program Files\Java\*\lib\ext, where * stands
for any directory.
- Place the DLL files in the \bin subdirectory of your default JRE. If you aren't sure which
JRE you are using, copy the DLL files to C:\Program Files\Java\*\bin, where * again stands for
any directory.
|
- Make sure you have the latest drivers for your video card.
- Download the linux libraries
- Place the JAR files in $JAVA_HOME/jre/lib/ext.
- Place the SO files in $JAVA_HOME/jre/lib/i386.
|
Limited Access |
- Make sure you have the latest drivers for your video card.
- Download the windows libraries
- Set your classpath to include the JAR files. You can set environment variables in Windows
by going to "Start Menu->Control Panel->System->Advanced->Environment Variables".
There should be a section for the user defined variables, and you should add a CLASSPATH
variable whose value is ".;<project-path>\vecmath.jar;<project-path>\jogl.jar". To
test if this worked, open a command prompt and type "echo %CLASSPATH%" and ensure the printed
value is what it should be.
- As an alternative to setting your classpath, you can link the JAR file into eclipse by right
clicking on "Project->Properties->Java Build Path->Libraries" and clicking on the button
labelled "Add External JARs". Browse to the JAR files and add them.
- At the beginning of the
main function in MainFrame.java, add the following line
at the beginning:
System.setProperty("java.library.path", System.getProperty("java.library.path") + ";<project-path>")
|
- Make sure you have the latest drivers for your video card.
- Download the windows libraries.
- Set your classpath to include the JAR files. If you are using bash, or bash-like shells, do this
with the "export" command:
export CLASSPATH=$CLASSPATH:<project-path>/vecmath.jar:
<project-path>/jogl.jar . Use the command echo $CLASSPATH to make sure
it worked.
- As an alternative to setting your classpath, you can link the JAR file into eclipse by right
clicking on "Project->Properties->Java Build Path->Libraries" and clicking on the button
labelled "Add External JARs". Browse to the JAR files and add them.
- At the beginning of the
main function in MainFrame.java, add the following line
at the beginning:
System.setProperty("java.library.path", System.getProperty("java.library.path") + ":<project-path>")
|
Cornell CS465 Fall 2004 (cs465-staff-l@cs.cornell.edu)