Aztec Script Reference

AztecSceneObject Class

Summary

This class provides a reflection of an Aztec object to the scripting interface. Objects of this type are not directly created, but are accessed as either a property of the global "Scene" (for existing objects), or as a result of using a createXXX() method of "Scene".

Properties

The properties of an AztecSceneObject will depend on the underlying thing it is
reflecting.  If it is an object, then it will have the properties: Name, Tsl,
Rot, Scl, drawWire, shapeObj, mat, parent, and viewCol.  If it is a shape associated
with an object, then it will have the property "Name", plus all of the shape
specific properties (e.g., a cube will have  width, height, depth, ...).  If it
is a material it will have the properties: Name, Amb, Diff, Spec, Emm, Shin,
Opac, DiffFile, Cull.

Note that properties of scene objects are copied by value to a new object at
the time they are referenced.  This means that you cannot do something like this:
Scene.Cube01.Tsl.x = 4;  Instead you have to assign an entire AztecVector3 to
the property Tsl (e.g., v = Scene.Cube01.Tsl; v.x = 4; Scene.Cube01.Tsl = v;).
There are several boring technical reasons why this must be - but you need to
be aware that the properties of scene objects aren't quite the same as the
properties of standard JavaScript objects.

The properties listed below are for the basic object.  Shape and material objects
will reflect properties unique to themselves (material docs are TBD).
PropertyDescription
NameString holding the name of the object.
TslAztecVector3 containing the amount of translation for this object.
RotAztecVector3 containing the amount of rotation for this object.
SclAztecVector3 containing the amount of scaling for this object.
drawWireOn/Off - determines if the object will only be drawn using wireframe.  When on, the object will be wireframe, even if the window is in a solid drawing mode.
shapeObjAztecSceneObject reference to an object that holds the shape unique properties of this object.
matAztecSceneObject reference to the material assigned to this object.  Material unique properties will be reflected through it.
parentAztecSceneObject reference to the parent object of this object.
viewColColor to use when drawing this object.

Example

Typical uses:
Retrieving a scene object as a property would look like this:

js: light1 = Scene.whiteLight;
[Aztec Object: whiteLight]
js:

Below is an example of creating a cube primitive and examining it's properties.

js: cube1 = Scene.createObject('Cube')
[Aztec Object: Cube]
js: for (x in cube1) print(x)
Name
Tsl
Rot
Scl
drawWire
shapeObj
mat
parent
viewCol

js: cubetx = cube1.Tsl;
[object AztecVector3]
js: cubetx.x
0
js: cubetx.y
0
js: cubetx.set(2, 3, 10)

js: cube1.Tsl = cubetx
[object AztecVector3]


Given the cube created above, the code below gets the shape associated with
the cube at lists the properties unique to a cube.

js: cubeShp = cube1.shapeObj
[Aztec Object: cubeShape]
js: for (x in cubeShp) print(x)
Name
Wd
Hi
Dp
WdDv
HiDv
DpDv

js: 

See Also

Groups [ Class ]
Documents [ LXR ID Search ]
Entries [ AztecVector3 | Scene ]

This page was generated by APIDOC