|
|
Purpose |
|
To implement a simple, object-oriented, hierarchical retained mode graphics library of the sort discussed in class.
A Conceptual Model for Object-oriented Graphics The conceptual model of our object-oriented retained-mode library is based on two simple and powerful concepts: graphical objects for building graphical scenes and properties for specifying the behavior of the graphical objects. The library uses the "damage-repair model": whenever a graphical object or property changes (is damaged), the image is repaired without programmer intervention. Graphical objects (GOs) represent all the logical entities in the graphical scene: geometry (e.g., lines, polygons, spheres, etc.), lights and cameras of various sorts, and groups of other GOs. One special type of group, the root GO, represents a viewport into which graphics are rendered. GOs can be grouped together in any valid directed acyclic graph (DAG). In particular, any subgraph rooted at a group GO can be linked into any number of other scene graphs as a child of some other group GO. Each property is a defined by some value that specifies how some attribute of the graphical scene changes over time. A property could either be a constant value, or a time-variant function that takes the current time and returns a value. Associated with each GO g is a partial mapping of properties to values determined by the properties that have been set on g. A property that has been set on g affects not only g but all the descendants of g that do not override the property. A root GO sets an initial default value for each named property. The Simplified JOOGL Model JOOGL simplifies the conceptual model somewhat. In particular, there are only a small set of GOs and properties in the system, and not all property values inherit down the scene graph. The few properties that do inherit were chosen either because inheritance is necessary (in the case of transformations), or because it was easy to implement (see below). Properties that do not inherit are hard coded into the appropraite nodes. Those that do inherit have actual objects to implement them. Furthermore, only the properties that inherit can be specified as time-variant functions (ie. most properties can only have simple, constant values). Finally, the set of properties and GOs, and the choice of which properties can be time-variant functions, where chosen so that JOOGL is sufficiently powerful to implement assignments #4 and #5 in a straightforward manner. |
|
|
|
Task |
|
Write a Java library that provides a retained mode library on top of
GL4Java. This is a simple library based on the concept of an object-oriented
library that uses a DAG of group nodes to structure the scene, and
has properties (possibly time-based) attached to the nodes to specify
the behavior of the scene.
The stripped down class files for the library are here. These class files implement some of the nitty-gritty methods that would be tedious and are tangential to the assignment. Pay very close attention to the comments and the structure of the code; some internal methods have been left in (although empty) to guide you. A collection of test programs using this library, and images of what the resulting graphics should look like, are here. Additional test programs may be posted to the class swiki. |
|
|
|
Turn in |
|
Your submission should consist of a collection of java class files which
implement the library. The TAs will evaluate it using the test programs
provided, as well as other test programs that may not have been provided
(which may test parts of the library not explicitely tested by the posted
programs). Your source files should be commented with the usual comments.
Your submission MUST be submitted using WebWork, as discussed in class. If you are unsure of how to submit using WebWork, talk to the TAs BEFORE THE ASSIGNMENT IS DUE. IMPORTANT: If the TA has to edit your files to compile your code, you will lose up to 25% of the grade you could have gotten. |
|
|
|
Due date |
|
This program is due at 9am on Friday October 18th. This means it must be received by 8:59am EDT on Friday to not be considered late. | |
|
|
Additional Instructions |
|
The joogl class files have been documented here. Make sure you understand the library before you start implementing it. It has been carefully designed to be powerful enough to be interesting, while being fairly straightforward to implement. In particular:
You library should do the following things:
Additional Comments The implementation of this library is fairly complex, and should be done incrementally. We will post more detailed information about how this will be graded as the due date grows closer, but the majority of the grading will involve compiling your library and linking it with a number of test programs: each program will test progressively more complex parts of the library. The most basic test programs are in the collection above. Pay close attention to what you need to implement in order to have that test program work. In particular, you do not need to support dynamic properties, property inheritance (of material, drawmore, shademodel or transformations), or to allow the camera or light nodes to be transformed within the scene graph for the first test program. This is a good example of where to start: support a simple hierarchy with properties attached to the leaf nodes. Additional test programs will require your library to support property inheritance, dynamic properties, embedding the camera and lights in the graph, and so on. |
|
|
|
EXTRA CREDIT |
|
There is one extra credit for this assignment, and that is to handle picking. The class files have an object (jooglPickable) and a method (jooglCanvas->pickRoot()) needed to perform picking on the scene graph, which provide the information needed to do OpenGL picking in a window. You should implement these routines. |