NavigationInfo{} : turn off your headlight; set your navigation type
Background{} : set your background color
Viewpoint{} : set your camera position(s)
Fog{} : hide distant items
MFNode field for
'wrapping around' sub-nodes.Group{} : strictly a container. Often used to scope lighting effects or organize the scene graph
Collision{} : a container that allows you to recieve notice when collisions
between the camera and sub-nodes occur, or to deactivate collision detection
on the sub-nodes altogether (a performance boost). Note that collision detection is on by default.
Switch{} : a container that displays one or none of its sub-nodes,
depending on the current whichChoice value.
Good for rollover type effects.
Sometimes used as a place to hide DEFs.
LOD{} : a container that displays one of its sub-nodes,
depending on how far away the current viewpoint is from the defined center of the LOD.
Used for displaying low-res geometry when the camera is too far to tell the difference.
Inline{} : an include mechanism. Inline imports a specified
vrml file into the scene graph. Note that there is no way for the vrml
browser to pre-compute the bounding box of an inlined file (so it may be a good
idea for you to do so).
Anchor{} : a hyperlink. Anchors may link to other viewpoints
in the current vrml file, other vrml files, other viewpoints in other files, or
to any standard web url.
Billboard{} : a camera-facing node. Sub-nodes are rotated about
the specified axis to face the current viewpoint. Great for faking trees, spheres,
distant clouds, and other [needlessly] complex geometry.
Transform{} : a modifier. Sub-nodes are translated, rotated, or scaled.
#VRML V2.0 utf8
DEF CUBE Shape {
appearance Appearance {
material Material {}
}
geometry Box {
size 1 1 1
}
}
Transform {
translation -2 0 0
children [
USE CUBE
]
}
Transform {
translation 2 0 0
children [
USE CUBE
]
}
DEFining a label for a node, we can later USE
the label to refer to the original node.
DEFined before it may be USEd
USE instance is identical and linked to the original;
any changes to the original will be reflected in all instances.
DEF CUBE Shape {
appearance Appearance {
material Material {}
}
geometry Box {
size 1 1 1
}
}
SFVec3f: x y z
Transform {
translation -2 0 0
children [
USE CUBE
]
}
SFVec3f: x y z. Transform {
scale .5 3 .5
children [
USE CUBE
]
}
SFVec3f defining an axis combined with an SFFloat specifying (in radians)
the amount to rotate about the axis.30 degrees positive rotation around the y axis: 0 1 0 .524360 degrees = 2 * PI radians:radians = degrees / 180 * PI degrees = radians / PI * 180which way around? remember the right-hand rule: point the thumb of your right hand along the positive direction of the axis in question. the direction that your fingers curl into your palm is the direction of positive rotation about that axis.
Transform {
rotation 0 1 0 .7853
children [
USE CUBE
]
}
Transform node happen together,
in a 'natural' order (scale, rotate, translate):
Transform {
rotation 0 0 1 .7853
translation 2 0 0
scale .5 .5 .5
children [
USE CUBE
]
}
Transform nodes, you can control the order of transformations.
Inner-most nodes are evaluated first, so the following will translate, then rotate:
Transform {
rotation 0 0 1 .7853 # second
children [
Transform {
translation 2 0 0 # first
children [
USE CUBE
]
}
]
}
example [»]Transform {
scale .5 .5 .5 # second
children [
Transform {
translation 2 0 0 # first
children [
USE CUBE
]
}
]
}
example [»]task02 [»]