Homework1W13

From Immersive Visualization Lab Wiki
Revision as of 22:44, 13 January 2013 by Jschulze (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Homework Assignment 1: OpenSceneGraph

Download, build and install OpenSceneGraph (OSG) under your Windows account. You will need to have VRML support, which is why you will need to install the the Coin3D library before OSG.

OSG is a graphics library which sits on top of OpenGL and will be the graphics programming interface in this course.

Next you will need to make yourself familiar with OSG. A good way to do this is by working through some of the tutorials. You should at the very least work through Tutorials 1 and 2 from section "Yet Another Set of Beginner Tutorials" on this web page. While doing these tutorials, it may be helpful to study other OSG documentation, for instance the Reference Guide.

Armed with this knowledge, you will need to load this 3D model of a kitchen by means of OSG's VRML loader. The command to load a VRML file into an OSG node is:

osgDB::readNodeFile()

Note that the a couple of the kitchen's cabinets are open and do not have doors. We will worry about that in a later homework assignment.

Next you will need to load two VRML pots into the same application. Place them on the kitchen counter when you initially load them in.

Finally, you will need to make each pot selectable separately by using the number keys '1' and '2', and make the selected pot movable by means of the cursor keys (to move it up/down, left/right) and the 's' and 'z' keys to move it into/out of the screen.

The selected pot needs to be rapidly blink. You can accomplish this by alternating between making it visible and invisible, with every frame you render. Use the Node::setNodeMask() command with parameters of 0 or ~0 to hide and show it.

In class, you will have to demonstrate the following things:

  • Run your program to show the kitchen.
  • Load the two pots and show them sitting somewhere on the counter top. This can happen at the same time as the kitchen is loaded.
  • Select one pot with its number key, it should blink now.
  • Use the cursor and s/z keys to move it into the upper cabinet.
  • Select the other pot.
  • Move it into the fridge.