VR Toolkit Overview and Scene Graphs
VR Toolkit Overview and Scene Graphs
is an Application
Programming Interface (API) -
VRProyae
An authoring environment
allows interact with
users to
base
the created w
runtime environment
creating virtual worlds, A
real time.
Internal node
Viewpoint O
node
Ball node
Palm node
OInternal node
Leaf node Thumb node Pinkie node
Scene graph
3.2.1 Before the virual ball is grasped -
Fig.
For example, consider a simulation where a user wears sensor gloves with trackers and tries
grab a virtual ball. Fig. 3.1.1 shows the first scene showing both the virtual hand and the bouncim,
Scene graph, the ball leaf node (which contains geometry and color) is achild
ball. In the
the bounce effect.
inner node whose values change to reflect
After the virtual ball is grabbed, it becomes a child of the palm object, as shown in Fig. 321
Now the parent node inside represents the position inside the palm. In this way, atransform applict
to the palm also affects its children (fingers and ball),. indicating that they move together. Th
tracker worn by the luser
parent node inside the palm represents the deformation caused by the
Root node
Internal node
View point O
node
Ball node
Palm node
O Internal node
Leaf node Thumb node Pinkie node
Scene grah updates occur once per frame and affect node attributes. This process hapat
recursively from the root node to the leaves and back to the root node. The down loop n
changing node attributes (including update transforms); and the up loop. Computes the nok
bounding volume. A bounding volume is a bounding box that encloses the virtual obja
represented by a node. A parent node's bounding volume encloses all of its children's bounditg
volumes.
Once the scene graph has been updated, it can be processed by the graphics Pipeline. This
called traversal and new frames are generated. The scene diagram reflects the spatialandtempord
During the apply phase, the CPU performs intersection checks between parts of the scene
diagram(called subtrees) and the virtual camera's view cone. If the bounding volume surrounding
the subtree is outside the viewing cone, all associated objects will not be visible. Therefore, they
are not sent to the geometry stage of the graphics pipeline for processing. When the bounding
volume intersects the view cone, the object is sent through the graphics pipeline and clipped at the
geometry stage. This hierarchical culling of bounding volumes reduces the armount of computation
and leads to higher refresh rates.
3.3 WorldToolKit
WorldToolkit is one of the oldest toolkits for VR programming. having been introduced in the
early 1990s. Its popularity stems from support of most commercial 1/0 devices (such as trackers.
stereo glasses,and sensing gloves), multiplatform portability (from PCs running Windows, to SGl.
HP, and Sun platforms running some form of Unix), and substantial code examples that facilitate
setting up a new simulation. The toolkit is mostly used for smallto medium-size models owing to
the requirement to fit the entire virtual world on available system RAM memory.
Although many of the early toolkits have disappeared, WTK has grown in functionality and
functions
size (from 400 functions in 1994 to over 1000 functions in its latest release). The WTK
classes include
use an object-oriented naming convention and are organized in classes. These
and others. A special
geometris, nodes, viewpoints, windows, lights, sensors, paths, motion links,
the other objects.
class is the universe, which manages the simulation and contains all
WIgeometry begin():
WIgeometry_save(); knowledoe
PUBLICATIONS- an up-thust for
TECHNICAL
toobe included and
Realty/ Vitual
keality nodes in order
declaed as
Aignrsted
must be
properties of its material
geonetry detemined by tlhie
object
Note that appcaranceis he dark surface. Such
Ihe scene
graph. An obiets
andthe
cmissivity of a
glowin
naterial pope
anhient and
difluse
hehting
indexed by the
number of
[Link] be
Contained
materials,
Contained in
the table of
refercnce the
sane material table.
Material
create the
properties
surlace Leometry. If
specified ty
the
Peometies can
Studio, VRML, ete.)
uscd to materal
authoring tool
(3D follows :
if desired)as
modified
loaded and
CUsts, itcan be
WTyeometrynode load(hand);
property of an
object's appearance is its
surface
texture."Textures
Another inportant JPEG formats) and applied to the surface of
imported into WIK (in
RGB, TGA and obyuso
rotated, scaled) and mixed as nceded for example
(moved,
manipulated
Textures can also be
WTmtable load(filoname):
WTmtable_setvalue():
to anticipate all t r a n s l a t i
H H
Multiple mobile nodes can be connected hierarchically, as shown in Fig. 3.3.3. Here we build a
virtual hand using movable nodes. The mobile plmar joints are superior to the thumb, 1index
finger, middle finger, ring and small proximal mobile joints. The proximal movable thumb knot is
superior to the distal movable thumb knot and the proximal index knot is superior to the
intermediate movable index knot. (Refer Fig.3.3.3 on nextpage)
The lowest node in the hierarchy is the finger distal mobile node. If the geometry for each of
these hand segments exists (e.g. in NFF format), it must first be loaded into WTK. Next, create a
scene graph by attaching movable nodes, as in the following example.
/*load hand model geometry*/
Palm = Wtmovnode load(Root, "[Link]," 1.0);
ThumbProximal= WTmovnode load(Palm, "[Link],"'1.0);
ThumbDistal=WTmovnode load ThumbProximal, "[Link],"1.0);
IndexxProximal=Wtmovnode load(Palm,'[Link],"1.0);
IndexMiddle=WImovnode load(IndedProximal,"[Link],"1.0);
IndexDistal=WInovnode load(IndexMiddle, "[Link],"1.0);
MiddleProximal=WTmovnode load(Palm,"Middle [Link],"'1.0);
MiddleMiddle=WTmovnode load(Palm,'[Link]," 1.0);
'[Link],"1.0):
MiddleDistal= Wtrmovnode load(MiddleMiddle,
RingProximal=WTmovnode load(Palm,"[Link],"1.0);
load(RingProximal,"[Link], "1.0):
RingMiddle =WTmovnode
ingDistal =Wtmovnode load(RingMiddle,"RingDistal.
nff, "1.0);
DmalProximal=WTnovnode load(Palm,"[Link],"1.0);
'[Link],"1.0):
OmalMiddle =Wtmovnode load(Smal Proximal,
load(SmallMiddle,:[Link], "1.0);
OmallDistal =WTnovnode
Augmented Reality
/ Vitual Reality
Parent node
Separator
Palm
(Transform) Content
Movable node
Separator Middle proximal
Separator
Thumb proximal/
(Transform) Content
Transform) Content
(Separator
Index proximal
Separator (Transform Content
(Transfom Content
Separator
Thumbdistal
Index middle
(Transform) Content
Separator
Index distal|
Transform Content
furnctioris Calls
Unnere's acion
sonsor input
Objects arsupdated witth
Universe is rendered
WTuniverse_ready();
WTuniverse_go():
return();
problem by bundling
updates sent and
reckoning
received, To reduce the number of
estimate intermediate positions using dead
applications to
global Sync time. This allows
Or smoothing algorithms.
knowledge
CATIONS®. an up-thrust for
3- 12
VR Proga
AupmentedReality
/ Vitual Reality
Java has become the
3.5 JAVA3D Microsystems
in the
mid-1990s,
APIs
developdfor
object-oriented
passing using
WTK. Like
WTK, low-level
the Java
shown the
message
accelerators
graphics that implenent
Fig 351 functions and
the
library
download from
the Internet.
and Direct3D graphics
WTK. Java 3D
is a free
hosever, unlike New client
Client Client
Cient Clent with lock
The object's appearance (color, rendering mode, texture, transparency) is specitied by the Java
FD Appearance() class. These material and texture attributes need to be defined first and then
gTouped to form a new appearance as in
Mat=new Material():
Mat setDiffuseColor(r.g.b):
[Link] Color(r.g,b);
Mat setSpecularColor(r.g.b);
import texture file"/
Texdd= new textureLoader('checkered jpg..
Tex=TexlLd getTexture():
createtthe appearance and set it'/
Appr=new Appearance[%
TECHNICAL
PUBLICATIONS® an up-thrust for knowledye
3-14
VR Program
Reality
Augmented
Reality/ Virtual
A p p r . s e t M a t e r i a l ( M a t ) ;
[Link](Tex);
[Link](Appr);
Behavior
Locale
View
Content
branch branch
Behavior
handler
code
BranchGroup BranchGroup
Ambient
light
Dir.
TransformGroup light
TransformGroup)
TransformGroup/TransformGroup/TransformGroup/
ViewPlatform
ViewCanvassD)
Shape3D Shape3D Shape3D
Each branch graph has a group node called BranchGroup that defines
and acts like the glue that holds the elements of the branch together. A compatible subgraphs
places and group node
aligns leaf nodes into atransformation group node. Aswitch node allows you
to choose between
multiple subgraphs within a group and specify the level ofc detail. Finally, the
set determine the order in which branch leaf nodes (objects) are nodes in the ordered
rendered.
Java 3D's scene graph traversal order is less structured: Leaf nodes have Therefore, unlike WTK.
no child nodes
contain information or reference node component objects. A and either
very important leaf.
ViewPlatfom which sets the position and orientation of the virtual camera in the node is the
world. The Java
·TECHNICAL PUBLICATIONS an up-thrust for knowlere
nming d Reality/
A u g m e n t e d
Virtual Reality
3-15
3D application
manipulates
the value of VR Programming
through the virtual
world.. A his
form a Java
ViewPlatform node to allow the user to navigate
ViewPlatform together
3D
platform-independent with a View objcct (described later in this
chapter)
3D
erse
Shape3D leaf nodes
contain information view model.
(described above), as well
as the
about the virtual object's geometry and appearance
Ors bounding box needed for collision detection. Other leaf nodes
ore specify lighting conditions (ambient, point, directional),
background colors. predefined behaviors, fog and universe
If we need to add a virtual hand
to the virtual
into the scene graph. The
world, we need to load that her VRML WRL file
following example shows howto
individually and how to define a load each segment of the virtual hand
parent-child hierarchy between these segments (nodes).
B.6.1 Sensors and Behaviors
Input for simulations programmed in Java 3D is
provided via a set of 6DOF input deyices
Specified in the physics environment" class, Unlike WTK, Java 3D does not
support trackers or
other VR-specific input devices. Instead, the APIprovides an input device interface with which
device drivers (written in CICt+ by developers) must be linked. Users then define methods for
opening, closing and reading a particular device, as wellas setting and querying its status.
The above approach is taken to preserve the independence and versatility of the Java 3D
platform as a high-level graphics API. This generality is illustrated by the fact that input device
interfaces accept data from both real and virtual devices. This allows the simulation to be driven by
data stored in files, as is normally done when replaying user actions. Alternatively, the simulation
can read data from a network connection (remote sensing). Finally, the user can create a
"ranslator" between 2D mouse data and 6D tracker data, turning the mouse
into a virtual tracker
device.
sensor objects are associated with each input device object. The latest data from
One or more
buffer. The
sensor obiect is contained in a series of SensorRead objects placed in a circular
each
obiect contains his 6DOF data (or less) with a timestamp and an integer array of
SensorRead
simplifies the task of averaging sensor data and making predictions
pushbutton, values. Java 3D button value indicates whether the
time-stamped data. The
based on existing data by providing trigger state.
button-down state, or
button is in button-down state, Java
graphic and audio displays are linked to
devices and output to
Input from simulated input graphics display(CRT, Stereo HMD or
CAVE) used
3D View objects. This describes the type of
vicew has one or more Canvas3D obiects
PhysicalEnvironment. Each
specified by
e Simulation
knowledge
PUBLICATIONS- an up-thrust for
uCAA
Aiyt Aeaih/\itval Reaty
part of the
VROj at
which it is drawn. Thus area is display's
arcaN in
nat seltthe sorvn initial position relative to the
The Vicw objcct also describes the user's
Sereen3
availability and position as determined by the display policy.
and the tracker's
(such as height and IPD) are specificd by
the PhysicallBody.
Charactersthes
Virtual
univerSe
Behavior
Content Locale View
branch branch
Behavior
handler
code
BranchCGroup BranchGroup
Ambrent
aght
Dir.
TransformGroup light
TransformGroup/
TransformGroup TransformGroup TransformGroup/
AppearanceGeometry AppearanceGeometry
body
Fig. 3.6.2. Java 3D scene
graph for single
ViewPlatform node and multiple views
Augmented Reality / Virtual Reality
3-17
VR Programming
Virtual
universe
Behavior
Content
Behavior branch Locale View
handle branch
code
BranchGroup
Ambient BranchGroup
light
TransfomGroup Dir.
light
TransformGroup,
TransformGroup TransformGroup TransformGroup
ViewCanvas3D ViewCanvas3D
Wake of the
user-specified
behavior.
animations,
transform
changes and SO On.
level
Multiple operalions
result in scene graphchanges,
other. Aspecial behavior is of
detail, which
interfering with each and
Tùn in parallel without ViewPlatform position
the calculate he
generalized by the Java
3D class LOD. Track appropriate child node of the dislat
This distance isassigned to the switch no
to the object surface. distance-based
switching of object level of detail.
The DistanceLOD class implements
TECHNICAL PUBLICATIONS an
up-thrust for
Augmented Reality / Virtual Reality 3-19
VR Programning