User Guide

Chapter 19484
Model commands
Use these commands to work with models:
visibility Get and set The way in which the sides of the model’s resource
are drawn. The choices are as follows:
#none, in which no polygons are drawn and the
model is invisible.
#front, in which only polygons on the outer
surface of the model are drawn, so that, if the
camera were inside the model, the model wouldn’t
be seen. Also known as “back face culling,” this
option optimizes performance.
#back, in which only polygons on the inside of the
object are drawn, so that if the camera were outside
the model, the model wouldn’t be seen.
#both, in which all polygons are drawn and the
model is visible regardless of orientation. This may
solve drawing problems, but it can also affect
performance because twice as many polygons
must be drawn.
The default is
#front.
#none:
#front
#back
#both
debug
Get and set Value indicating whether debug information is
drawn for this model. If the value is
TRUE (1),
lines from the x, y, and z axes are drawn sprouting
up from the model to indicate its orientation, and a
bounding sphere is drawn around the model.
TRUE (1) or
FALSE (0). The
default is
FALSE
(0)
.
bounding
Sphere
Get A list containing a vector and a floating-point value.
The vector represents the position of the model in
world space, and the floating-point value
represents the radius of the bounding sphere that
contains the model and its children.
bounding
Sphere
world
Position
Get Position of the model in world coordinates. A quick
shortcut for
model.getWorldTransform().
position
.
world
Position
pointAt
Orientation
Get and set A list of two orthogonal vectors,
[
objectRelativeDirecton,
objectRelativeUp
], that control how the
model’s
pointAt() method works.
pointAt
Orientation
Command Description Returns
addChild(aNode,
preserveWorld
)
Adds aNode to this model’s list of children. An equivalent
operation is to set
aNode.parent to equal this
model
.
The
preserveWorld argument is optional. It can have
two values:
#preserveWorld or #preserveParent.
If the value is
#preserveWorld, the default, the world
transform of the child being added remains intact. If the
value is
#preserveParent, the child’s
existing transform is interpreted as parent-relative.
Nothing
child[index] Returns the child at the specified position in the index. Node object
child(name) Returns the child named name. Node object
Property Access Description Value