Various Hints and Bits of Advice

Suggestions welcome!

Online documentation

There is online documentation (within ANU only) for JOGL and GLUT.

Test and exam questions

Sample questions and the ANU has copies of exam papers from previous years.

Multiple images in the window

Simple 3D programs like the cube exercise may show multiple images in the window at once. This happens because the nVidia graphics cards are really fast and screen updates are not being limited to one per LCD/CRT frame. You can synchronise drawing by setting an environment variable from your terminal.


    $ setenv __GL_SYNC_TO_VBLANK 1

Compiling with JOGL in N111

You need to add JOGL to your classpath with


    $ setenv CLASSPATH ".:/usr/local/java/jre/lib/jogl.jar"

Copying files between R105 and other places

The R105 server is ephebe.anu.edu.au. You can ssh or scp to ephebe from inside or outside the ANU.

System clock

To get the number of seconds as a floating point value since the program began, the Java code should look like:
import java.util.*;
// Initialise
static long Start;
Date now = new Date();
Start = now.getTime();
...
// Current time
Date now = new Date();
float seconds;
seconds = (float)(now.getTime() - Start) / 1000.0f;
and the C code:
#include <sys/time.h>
...
/* Initialise */
static long Start;
struct timeval now;
gettimeofday(&now, NULL);
Start = now.tv_sec;
...
/* Current time */
struct timeval now;
float  seconds;
gettimeofday(&now, NULL);
seconds = (float)(now.tv_sec - Start) + (float)now.tv_usec / 1000000.0;

Longer items

Geometry drawings

OpenGL Lighting

Virtual Reality System Development


Back to Computer Graphics.