THE AUSTRALIAN NATIONAL UNIVERSITY Final Examinations(Semester 2) 2009 COMP4610/COMP6461 (Computer Graphics) Final Exam Writing Period: 3 hours duration Study Period: 15 minutes duration - you may read text files and pdfs but you are not permitted to start answering questions. Permitted Materials: none Note the standard lab tools are available including : Java, eclipse, ooffice, kate, dia, gcc,... Please Read The Following Instructions Carefully. This exam will be marked out of 100 and consists of 4 questions. Questions are of unequal value. The value of each question is shown in square brackets. Questions that are partitioned into parts show the number of marks given to each part within square brackets. Students should attempt all questions. Answers must be saved into the question's directory (Q1, Q2, Q3, Q4) using the file(s) described in the question statement. Marks may be lost for giving information that is irrelevant. Network traffic may be monitored for inappropriate communications between students, or attempts to gain access to the Internet. 1/5
Question 1 - Short Answer [40 marks] Highest marks are gained by providing: clear, concise, and short answers. Save your answers in the in the file 'Q1Answers.odt' in the directory Q1. This file can be edited using 'ooffice'. Please make certain that this file is saved both as you progress through the exam and before the exam ends. i. [4 marks] State how the screen co-ordinate of a pixel is mapped into a memory address in the frame buffer. ii. [4 marks] Why is it impossible to accurately display the CIE xy chromaticity diagram's colour on a RGB monitor? iii. [4 marks] Explain one approach for determining if a point is in the interior of a polygon or not (assume both the polygon and point are on the same plane). iv. [4 marks] Why are homogeneous coordinates so useful in Computer Graphics? Show the form of the translation matrix (assume 2D space). v. [4 marks] Provide an example of temporal aliasing. Give two approaches that could be used to help address this problem. vi. [4 marks] State two different approaches used for specifying a 3D rotation. Contrast some advantages/disadvantages of these approaches. vii. [4 marks] Explain how the 'reverse painters algorithm' works. What is the main advantage of this approach over the 'painters algorithm'. viii. [4 marks] How would the differences between flat, Gouraud, and Phong shading be visually evident within an image. ix. [4 marks] How are 'blobby objects' defined? What types of objects are they good at representing? x. [4 marks] Modern GPUs have programmable pixel shaders(also known as fragment shaders) as part of their rendering pipeline. What types of effects can be obtained from these programmable pixel shaders? 2/5
Question 2 Lab [15 marks] The Q2 directory contains the 'ScreenSaverOGL.java' and 'ScreenSaverOGL.c' files. These are a simple screen saver programs. Copy and rename one of these files for your answer file, call it SimplePoly.java (or SimplePoly.c). Save this in the Q2 directory. Create a simple polygon that rotates in 3D on it's y-axis. Duplicate this polygon 4 times so that the same polygon is rotating simultaneously in 4 different places on the screen. In doing this you should use either a method for drawing the shape which you call 4 times or a using a display list (i.e. glnewlist, glendlist, and glcalllist). This will also involve using glpushmatrix and glpopmatrix. Add a comment in your answer file which gives the commands used to compile and run your code, also in this comment add a very brief summary of what you did. 3/5
Question 3 Lab [15 marks] The Q3 directory contains the code files for the ray-tracing lab. Modify the 'raytrace' method in 'Scene.java' such that it's illumination model includes both diffuse and specular reflection. This may be from a single light source. You should adjust lighting parameters such that both the diffuse and specular effects are viewable. Make a note of the formula you used for your illumination model(place this note in a comment in Scene.java). The directory 'Q3/original' contains a copy of the original code. Do not modify this code. Only modify the code in the 'Q3' directory. The 'Q3/original' code is provided just in case you wish to see an unmodified version of the ray-tracer or if you need to recover this information. To run this code (once you have compiled the code) you may need to increase the amount of memory Java can use: java -Xmx200m RayTracer 4/5
Question 4 Lab [30 marks] Note part marks in these questions may be gained for: partial working solutions; or just a viable description of how you would approach such a problem. Please copy code as needed from either the Q2 and Q3 directories. Do only ONE of the following two options: A. The ray-tracer currently only renders spheres. Add to it the ability to render textured rectangles. These rectangles are in a plane that is perpendicular to the z axis, their left and right edges are parallel with the y- axis and their top and bottom edges are parallel with the x-axis. That is, if a corner vertex of the rectangle is at (x,y,z) and it has width w and height h then the rectangle would have the following vertices (x,y,z), (x+w,y,z), (x+w,y+h,z), and (x,y+h,z). The texture is available from a 'png' file and mapped to fill the entire rectangle. The lighting model on the surface of the rectangle may either: combine diffuse and specular effects with the colour determined by the texture; or just be determined purely from the colour of the texture. Included in this directory is the banner for the computer graphics subject (called banner.png). Add this banner to the juggler scene such that it moves towards and away from the viewer over the cycle of rendered frames. An example of one frame is given in the diagram to the right. The README file should contain a short summary of what you did. B. Using OpenGL create a 3D domino simulation. A domino is basically a thin box standing on its end. These are positioned next to each other such that the falling of the first domino hits the next and causes it to fall over. This continues causing all the dominoes to fall over. Create an animated sequence in which dominoes fall over. The simulation should include a line of dominoes that has a curve. It should also include a 'fan-out' (one domino hits two dominoes in a fall creating two lines of falling dominoes). Also include different colour dominoes. An example of an initial set up is shown in the diagram to the right. The README file should contain a short summary of what you did. 5/5