![]() |
ANU College of Engineering and Computer Science
School of Computer Science
|
|
|
OpenGL 2DThe main objective of this lab is to gain some experience using Open GL. In particular I hope students gain the idea that Open GL acts like a state machine and that you need to be mindful of the current state when you generate graphics using it.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. Note you will need to translate the code over to c. The lab begins with a simple screen saver (not really a screen saver as it exists in a window). Use your imagination in thinking up interesting improvements, however, you need to make certain that you cover the required features. Step 1 (3 marks)Obtain a copy of either ScreebSaverOGL.java or screensaver.c which form a simple screen saver program. Compile and run it. For the JOGL version you need to include the jogl jar files. Add the libraries /usr/share/java/jogle.jar and /usr/share/java/gluegen-rt.jar to the class path.Examine the code to understand what each line does. Note that, when this lab is marked you may be asked to explain parts of this code. Make the screen saver more interesting. This will involve drawing something that must include:
Step 2 (2 mark)Add an image to your screen saver that rotates and moves around the screen (use a png image or some image that you load).Step 3 (1 mark)Re-write your screen saver using Graphics2D such that it is visually basically the same. Contrast the performance of these two approaches (CPU usage, frame rates, visual differences, etc). Add extra items to the screen savers to see how the two approaches perform under greater loads. | |||||||||||||||||||||||||||||||||||||||||||||
|
Please direct all enquiries to: ericm@cs.anu.edu.au Page authorised by: Head of School, SoCS |
| The Australian National University — CRICOS Provider Number 00120C |