Josephine Home

XP One

Miscellaneous ExampleScene - introduces the Object Node
Object Node  "object"
 
attribute use what it does
file file = model.pfb loads models
translate  translate = "5 5 3" translates model
rotate rotate = "0 0 30" rotates model
scale  scale = "3 3 3" scales model
floor floor = 1 (default is 0) collision detection
wall  wall = 1 (default is 0) collision detection
draw draw = 0 (default is 1) does not draw object - used for "invisible" collision detection
grab  grab = 1 (default is 0) makes object grabbable, by default the middle button will grab objects, highlights grabbale objects

Light Node "light"
attribute use what it does
color color = "1 1 1" sets color between 0 and 1
position position = "-1 0 1 0" xyzw - if w is zero the light is at infinity, xyz are vectors
if w is 1 - the light is local, xyz are positions
messages
on, off, toggle on, off, toggle turns light on, off. toggles light

ExampleScene2 Messages
 Xp nodes can send and receive event messages, so that they can effect one another.
For example the light node understands the messages on, off and toggle.
A common attribute to all nodes is name, eg "name = light1", so light1 can be told toggle
For example the wandtrigger can  signal that the following "events" has occurred, "button1".
example

In our examples the wand and user trigger are playing sounds. ie. sending messages to the sound nodes to play sounds.
 
UserTrigger - enter exit
WandTrigger - enter, exit, button1 2 3
SoundNode uses BergenServer -you can use aiff or aifc files.


Automatically Created Nodes
XP makes a navigator node and a world node, but we can send messages to alter them in the text file.
They take a % sign to indicate they are nodes made by the program not by us.
Our triggers are changing the sky color, we can also set clipping plains and fog.
We can change the navigator speed, teleport and follow paths, among other things

navigator
world
Syntax in text file

alphaNode(attributes inside braces, separated by commas, translate = "1 2 3", the quotes are important)
{
    all nodes between the curly braces are children of the alphaNode
}

# comments out a line - must be at the very beginning of the line