Scene Graphs in Ygdrasil
Messages
- Elements in a Ygdrasil scene graph are
initialized with messages called "initial messages"
- a ygTransform node takes the
following messages
- position ( float,
float, float )
- orientation ( float,
float, float )
- size ( float |
float, float, float )
- a ygObject node takes, among
others, the following messages
- file ( string )
- cache ( [bool] )
- a ygSwitch node takes the following
messages
- Elements in a Ygdrasil scene graph are changed
during runtime with events
- events are
"generated" by nodes
- the ygCAVEWand, derived from ygWand, node generates button
related events
- button1
- buttonUp1
- button2
- buttonUp2
- button3
- buttonUp3
- we can used the when message to send messages to
other nodes in response to events
- when( eventName,
message )
- for example when(
button1, mySwitch.on )
- only the node that
generates the event can respond to the event
- nodes that receive
messages from other nodes need to have a unique name (i.e. mySwitch)
example
Establishing Space
- Often we will want to establish spaces
- for establishing
environmental effects
- fog
- clipping planes
- background colors
- for detecting the
presence of users and wands
- for limiting the
locations within which events can be generated
- the ygSpace
node can establish a space with the following volumes
- infinite
- sphere
- box
- cylinder
- point
- the userTrigger
node is a ygSpace node that
generates events in the presence of a ygHead node
- enter
- exit
- empty
- firstenter
- the wandTrigger
node is a ygSpace node that
generates events in the presence of a ygWand node
- enter
- exit
- any events generated by
the ygWand node (i.e. button1)
example
Establishing User Presence
- the user plays a significant role in the
virtual world
- we care about much
more than rendering the scene from the head perspective
- we care about
determining where the user is in the scene
- the userTrigger node detects the
presence of a ygHead node
- we care about
determining the location of the user wand and the direction it is
pointing
- the wandTrigger node detects the
presence of a ygWand node
- the pointAtTrigger node detects if a
ygWand node is pointing at
something
- we may also want to represent the user in the
scene graph just like we represent the rest of the scene
- a user avatar
requires the following minimum parts
- the following
additional elements add to the avatar
- body - located below
the head in a consistent orientation
- articulated arms
- articulated legs
- we can use a ygCAVETracker node to position the ygWand or ygHead
nodes
- a transform node that
gets position and orientation from a sensor
- usually the head
sensor is sensor number 0
- usually the wand
sensor is sensor number 1
- the ygUser
node
- establishes the CAVE
frame of reference
- allows a unique name
to be assigned to each user
- head and wand
trackers are always relative to the CAVE frame of reference
- the ygNavigator node navigates the
CAVE frame of reference to different locations and orientations within
the scene
- the ygCAVENavigator node implements
the traditional "point and move" technique
example