Sample Applications: Scene Graphcs

BillboardNodes: Illustration of 2D and 3D billboards that always face the camera.
BlendedAnimations: An animated skinned biped with an idle, walk, and run animation that are blended for smooth transitions.
BspNodes: A BSP scene hierarchy for spatial ordering of objects.
CameraAndLightNodes: Automatic updates of position and orientation for cameras and lights as nodes in a scene.
Castle: A large scene that requires culling for fast rendering. The picking system is used for collision avoidance and staying on the ground.
CLODMeshes: Continuous level of detail for a triangle mesh.
DLODNodes: Discrete level of detail based on distance from camera.
IKControllers: A simple inverse kinematics example with a few joints and a single end effector.
MorphControllers: A morph of multiple surfaces.
MorphFaces: A morphing face. The vertex color channel is interpolated during a portion of the animation.
ParticleControllers: A simple particle system.
Picking: Picking (selection) of geometric primitives (points, segments, triangles) using the mouse.
PointControllers: A simple point system containing randomly moving points.
SwitchNodes: Nodes for discrete level of detail by selecting a single child to draw.
Terrain: A tiled terrain system with wrap-around tiles (toroidal topology).

BillboardNodes. Illustration of 2D and 3D billboards that always face the camera. A couple of images with different camera positions and orientations. In each case, notice how the 2D and 3D billboards rotate about their model axes to face the camera.

BillboardNodes0 BillboardNodes1
When DEMONSTRATE_VIEWPORT_BOUNDING_RECTANGLE is exposed, the axis-aligned viewport bounding rectangle of the torus is drawn as a translucent screen space polygon. The four images show the rectangle for different camera positions and orientations.

BillboardNodes2
When DEMONSTRATE_POST_PROJECTION_REFLECTION is exposed, a post-projection reflection matrix is activated (in the Camera). It is an x-reflection, which the following image shows.

BillboardNodes3

BlendedAnimations. Blending of idle, walk, and run cycles for a skinned biped. The first image shows the biped in the idle cycle. The second image shows the biped in the walk cycle. The third image shows the biped in the run cycle. When in idle, you press the up-arrow and see a transition from idle to walking. Press shift-up-arrow to see the transition from walking to running

Idle Walk Run

BspNodes. Sorted drawing using coarse-level BSP trees. The partitioning of the world by four BSP planes. Only the square region defined by |x| ≤ 1 and |y| ≤ 1 is shown.

BspPartition
A view of the world. Compare this with the previous image showing the BSP partitioning. The torus is a nonconvex object, so when the drawing pass reaches the leaf node corresponding to the region containing the torus, the depth buffering is enabled. The other objects are convex. When the drawing pass reaches a region associated with a convex object, depth buffering is disabled, both reading and writing.

BspNode0

CameraAndLightNodes. Automatic updates of position and orientation for cameras and lights as nodes in a scene. The first image shows a simple scene with a ground polygon and texture. The Camera used for rendering is contained in a CameraNode object. The up-arrow and down-arrow keys control the forward/backward translation of the CameraNode. The left-arrow and right-arrow keys control the rotation of the CameraNode about its up-axis. The spot-light illumination is actually generated by a point light. However, the point light illuminates two triangle meshes, each in the shape of a paraboloid. The meshes are positioned in such a manner so that the ground polygon clips them, giving the appearance as if the lit geometry forms disks. The meshes are also translucent, so you obtain blending of the lit mesh and the ground, giving the appearance that the ground is being lit. The second image shows a wireframe of the scene, so you can see the actual lit meshes.

CameraAndLightNodes0 CameraAndLightNodes1

Castle. An outdoor environment plus a large castle data set. The screen captures were made when the castle was unlit. The current code adds lighting via some simple shaders. On program initialization, the camera is placed far away from the castle. The initial screenshot is the following image. Not much of the castle is visible. The wireframe image shows what is occluded.

Castle0 Castle1
Using the up-arrow or down-arrow keys to translate the camera forward or backward, and using the left-arrow and right-arrow keys to rotate the camera about the world up-vector, the camera is moved closer to the castle. A collision detection-avoidance system is used to prevent the camera from running through obstacles. The left image is a screenshot with the camera closer to the castle. You must cross the drawbridge over the moat to get into the castle. The right image shows the scene after you first cross the drawbridge and enter the courtyard of the castle.

Castle2 Castle3
Continue forward and walk up the stairs to enter the castle. After passing through the doorways, turn left and walk inside the left wing of the castle. Wander through the halls until you find a room with a barrel of ale, a few tables and benches, and a wall hanging. If you left-click on the wall behind the barrel, you will see the triangle mesh name fronthall_mesh0. A left-click on any object will display the name of that object (see left image). If you now right-click on the wall behind the barrel, that mesh is displayed in wireframe so that you can see what is behind it. In this place, all you see is the sky and the moat around the castle.

Castle4 Castle5
A view outside a window from inside the castle.

Castle6

CLODMeshes. Continuous level of detail for a triangle mesh. The left image shows two triangle-mesh faces. Both use CLODMesh for continuous level of detail. The collapse records are shared between the two objects. The current number of triangles used by the meshes is displayed at the top of the screen. The right image shows the scene rotated using the virtual trackball. The object closer to the camera has a larger number of triangles than the object farther from the camera. The triangle counts vary as the camera moves, whether transations or rotations.

CLODMeshes0 CLODMeshes1

DLODNodes. Discrete level of detail based on distance from camera. This is a simple application to show how to use the DLODNode class. The sequence of models from highest level of detail to lowest level of detail is: sphere, icosahedron, dodecahedron, octahedron, hexahedron, tetrahedron. Initiallly, the camera is close to the sphere, which is then drawn. As the camera is translated backward from the sphere, the model switches to the next lower level of detail. The following images show the display just after each switch point. The level of detail decreases from top row to bottom row, and from left to right within each row. Naturally, in a real application you would want a sequence of models that change gradually as each switch point is encountered.

DLODNodes0 DLODNodes1 DLODNodes2
DLODNodes3 DLODNodes4 DLODNodes5

IKControllers. A simple inverse kinematics example with a few joints and a single end effector. The left image shows the initial configuration. The box closest to the camera is attached to the ground and is allowed only to rotate about its up axis. The middle box is the end effector and is attached to the closest box by a rod that is allowed to contract or expand in length. The middle box is allowed only to translate vertically. The box farthest from the camera is the goal that the end effector must try to reach. The middle and right images show that the goal has been translated upward and toward the camera. The end effector has translated vertically to match the height of the goal and the ground box has rotated appropriately.

IKControllers0 IKControllers1 IKControllers2

MorphControllers. A morph of multiple surfaces. The left image shows one of the morphs of the multiple surfaces. The right image shows a morph and wireframes of the multiple surfaces that act as the morph targets.

MorphControllers0 MorphControllers1

MorphFaces. A morphing face. The vertex color channel is interpolated during a portion of the animation. The sequence is somewhat lengthy. Here are a few screen captures during the morphing.

MorphFaces0 MorphFaces1 MorphFaces2

ParticleControllers. A simple particle system. The particles are billboarded squares, each with an RGBA texture. The alpha channel is selected so that the squares appear as if they are fuzzy red disks (red blood cells randomly moving about). A couple of screen captures are shown next.

ParticleControllers0 ParticleControllers1

Picking. Picking (selection) of geometric primitives. The pick ray origin is the camera world position and the pick ray direction is the that from the camera world position through the point on the near plane corresopnding to where a mouse click event occurred. The images are numbered from left to right. Image0 is an image showing four geometric primitives: a torus, a dodecahedron, a polyline, and a set of four points. Image1 shows the scene where a mouse click was used to select objects. The first point on the ray is shown as a black sphere. Image2 shows a different view of the scene so that you can see the pick ray intersected the torus 4 times and the dodecahedron 2 times (6 black spheres). Image3 shows the scene where the mouse click occurred near the polyline. The nearest point on the polyline to the pick ray is drawn as a black sphere. Image4 shows the scene where the mouse click occurred near one of the four point primitives. The nearest point to the pick ray is drawn as a black sphere. Image5 shows the scene where the mouse click occured near the polyline and the pick ray intersects the torus; the scene was rotated slightly so that you can see both spheres that indicate the picked points.

Picking0 Picking1 Picking2 Picking3 Picking4 Picking5
Picking of triangle primitives uses ray-triangle intersection finding. Picking of point and segment primitives uses ray-primitive distance computations; the picker needs to be told a small distance within which primitives will be listed as near the ray.

PointControllers. A simple point system containing randomly moving points. The left image is the initial configuration. The right image has the camera moved far away from the points.

PointControllers0 PointControllers1

SwitchNodes. Nodes for discrete level of detail by selecting a single child to draw. The scene graph has a SwitchNode with 11 children but only one of them is active at a time. The application allows you to press the 'c' key to select the next child to be active. The first four children are shown in the images.

SwitchNodes0 SwitchNodes1
SwitchNodes2 SwitchNodes3

Terrain. A tiled terrain system with wrap-around tiles (toroidal topology). Two screen captures from the sample application. The fog is obtained via the vertex shader and increases in density exponentially with depth. The height of the camera over the terrain at its current location is displayed. The normal vector of the height field at that location is also displayed.

Terrain0 Terrain1