Groups, Lights, Cameras |
Groups in Shockwave 3D§ are scenegraph nodes, stored in the Node Hierarchy Palette, that preserve hierarchy information. They have no resources associated with them beyond their name and local transformation matrix.
Lights act as group nodes, in that they can be used to preserve a scenegraph hierarchy, exist as separate entries in a palette specific to their type, and have resource objects that hold information about them.
All the lights used by a Shockwave 3D scenegraph are listed in the Light Resource Palette. Unlike the Node Hierarchy Palette, the Light Resource Palette contains no hierarchy or transformation information. Instead, it is simply the mechanism for querying a light by name, and accessing its corresponding Light Resource object. The Light Resource object contains information about the light such as its color, type, and attenuation. There is one Light Resource object for each light listed in the Light Resource Palette.
When a light is created, it has the identity transform applied to it. If the light is a directional light, this causes it to face down the negative Z-axis with the positive Y-axis as its "up" vector.
Cameras (Views), like group nodes, are stored in the Node Hierarchy Palette. Unlike group nodes, however, they contain not only basic hierarchy and position information, but also the full set of camera parameters.
When a camera is created, it has the identity transform applied to it. This causes it to face down the negative Z-axis with the positive Y-axis as its "up" vector. The field of view for a perspective camera is assumed to have a 4:3 (horizontal to vertical) aspect ratio, and should be stored in terms of the vertical angle when calling IFXView::SetProjection(). For reference, if the authoring tool provides a horizontal field of view angle, it can be converted to a vertical one with the following formula: verticalCameraFOV = 2.0*atan(tan(horizontalCameraFOV/2.0)/1.3333333).
Note: To animate group, light, and camera (view) nodes, you must first make the node a child of a mesh (which can be made invisible by the "sw3d_visibility" user property) and then animate the mesh. Group, light, and camera (view) nodes cannot be animately directly.
§See asterisked (*) statement at Legal Information © 2001 Intel Corporation.