CECS Home | ANU Home | Search ANU
The Australian National University
ANU College of Engineering and Computer Science
School of Computer Science
Printer Friendly Version of this Document

UniSAFE

Computer Graphics

OpenGL 3D Materials and lighting

The main objective of this lab is to gain some experience in different materials and lighting using Open GL. In particular I hope students gain an understanding of different types of lighting and how it interacts with different materials.

By default I have set up this lab in Java using JOGL, however, you are free to complete this lab in c if you like.

Step 1 (4 marks)

Obtain a copy of ScreebSaverOGL.java which forms a simple screen saver program(the same as the last 2 labs). Compile and run it(you need to include the jogl jar files along with set up the LD_LIBARAY_PATH).

Create a Rubix cube that rotates on an axis. You must include some form of specular lighting. Given that Rubix cubes are shiny, you should see a bright spots or regions at particular angles.

Step 2 (1 marks)

Create an object that is made up of curved surfaces. Use vertex norms along with Phong shading to help generate a more realistic and smooth looking surface.

Step 3 (2 marks)

Add a floor to your scene and move your object across the viewing window with an shadow of your object on the floor. Note OpenGL does not do shadows! So this is a little tricky but still possible.

So to obtain full marks you need to do Step 1 along with Step 3. You can skip Step 2. The maximum you can gain for this lab is 6 marks. That is if you complete all three steps you will still only gain 6 marks not 7!