The make-up of shockwave 3D casts
Defining Shockwave 3D objects
Shockwave 3D cast members are treated very differently to other media
types. A typical sprite is an instance of a cast member. A shockwave 3D
sprite is a viewport into the cast member's 3D world. The 3D world is made up of
a number of objects (listed below), and these objects can
have a parent - child relationship (explained at the
bottom of this page).
model resource
A model resource is the 3D geometry or polygon mesh that describes the form
of a model. A model resource is only visible when in use by a model. Several
models can use the same model resource. For example, a scene can contain
100 boxes. If the boxes are all based on a single model resource, then changing
the properties of the box model resource would simultaneously update all
the other boxes in the scene.
model
A model is the visible 3D object in a shockwave3D world. It is based on
a model resource(s) and has materials (shaders) as one of its properties.
Models are usually created in 3D modelling applications like 3DS Max. However,
you can create models with Lingo alone. With Lingo, you can create produce
primitives (spheres, boxes, planes), particle systems and complex models
(with the mesh commands). For more info on tools to create shockwave 3D,
look at - DOUG-
Shockwave 3D Tools 4 U.
The relationship between a model and a model resource is similar to that
between a sprite and a cast member. Model resource data can be reused, because
multiple models can use the same model resource, just as cast member data
can be reused by multiple sprites. Unlike sprites however, models don't
appear as individual entities in the Score and can't be controlled from
it either.
material
A material is an entity that allows a model to be rendered with simulated
surface attributes, such as colour, reflectivity, transparency, shininess,
smoothness. A material defines the totality of the look within a shader.
shader
Shaders are rendering algorithms that define the overall look of a mesh.
A rendering algorithm is a method used to calculate the light as it is projected
on an object surface. The shader defines how any material created in it
will handle things like shininess, opacity, bumps.
In Max, the standard rendering algorithms are Constant, Phong, Blinn and
Metal. Shockwave 3D, like most game engines, supports only the Gouraud shader.
Since Shockwave 3D only supports one shader, in Director it is used as the
equivalent to a material in 3DS Max, and so materials are not considered
as separate objects to shaders
texture (map or texture map)
A texture is a bitmap image that can be one of a material’s attributes.
Textures can also be used by cameras as overlays (appearing in front of
the 3D world) or backdrops (behind the 3D world).
camera
A camera is a viewport into the 3D world. When a 3D member is placed on
the Stage, the sprite we see is a particular camera’s view into the 3D world.
If no predefined cameras exist in the 3D member, a default camera will be
created. If cameras do exist, the first available camera in the 3D member
will be used for the view of the sprite.
To learn more about the creation and control of lights, see the Controlling
Cameras Tutorial.
lights
Lights illuminate objects in a shockwave3D world and enable objects to be
seen. Lights have their own properties including colour, direction, intensity.
By default, each 3D cast member contains one white light and has a default
position of upper-centre in the world. This light can be turned off by setting
its color property to rgb(0,0,0).
There are several light types available in Shockwave 3D worlds: |
|
ambient light |
general lighting that illuminates all objects in the scene |
directional light |
light shining to a specific direction but where distance to the light is not important. |
point light |
light coming from a certain point in space illuminating in all directions (like a light bulb) |
spot light |
a focused beam of light that can be pointed at objects or areas, like a torch or theatre spotlight, is similar to directional except the distance from the light to the object is taken into account. |
To learn more about the creation and control of lights, see the Turning
on the Lights - Lighting Lingo Tutorial.
group
A group is a collection of models, lights, cameras or other groups, that
have been formally associated (grouped) with each other. By moving, rotating
or scaling the group, you move, rotate or scale all objects of this group
simultaneously. A group can be created in the 3D modelling software or with
Lingo. Each 3D cast member has a default group called world, which
is the cast member itself.
A group has a name, a transform, and a parent, and can have one or more
children (parent-child relationships are discussed lower in
this page). Groups have no other properties. You create a new group
and then add models as children to it, or assign the group as the parent
to the models. Either way, you have to create a parent-child relationship
between the models and the group.
motion object
3D animations are called motions and are initiated by Lingo. A motion object
is basically an animation, either keyframed or bones based. Animations cannot
be created at runtime using Lingo, they must be authored in a 3D modeling
package like 3D Max or Maya and be imported. A model needs a modifier to
play back an animation (#keyframeplayer, #bonesplayer).
Director supports both model keyframe and character bone animations, and
modifiers are available to enable both. Keyframe animations modify a model's
transform properties over time. Bones animations modify the model's geometry
over time. Creating bones animation in a 3D modeling application can be
complex, but it results in more natural-looking movements. Motions can be
reused on any model in the 3D cast member, as long as the motion is appropriate
to the geometry of the model.
modifiers
Modifiers let you control many aspects of how models are rendered and how
they behave. When you attach a modifier to a model, you can then set the
properties for that modifier with Lingo. Depending on the type of modifier
you use, setting its properties can give you fine control over the model's
appearance and behavior.
palettes
Shockwave 3D organises similar scene assets into collections or tables called
palettes. For example, a model points to a model resource in the model resource
palette for its geometry. It points to a shader (or several shaders) in
the shader palette for its material. The shader(s) in return point to textures
in the texture palettes. Palettes hold objects that can be reused. The palette
structure helps avoid duplicate data in the 3D member and thereby keep its
file size down. Palettes exist for model resources, models,
shaders, textures, cameras, lights, groups and motions.
Shockwave 3D object relationships
Objects in a Shockwave3D world exist in a tree hierarchy called a scenegraph.
Each object is called a node. At the top of the scenegraph tree is
the root of the 3D world. Nodes, which can be models, groups, cameras
or lights, are attached to the world group. Every object (node) is
a child of a single parent. The connections between nodes
are links. Nodes that have no children are called leaves as
they are at the ends of the tree. A collection of children of a parent is
a branch.
All models are located within a parent-child hierarchy. A model can
have any number of children but only one parent. If a model does not have
another model as a parent, its default parent is the group called world,
which, for all practical purposes, is the 3D cast member itself. A model's
parent and children don't have to be models. Models, lights, cameras and
groups all share the same parent-child hierarchy. For example, a light can
be the child of a group (perhaps world) and the parent of a model.
The primary benefit of these parent-child relationships is that they make
it easier to move complex models around in the 3D world and to have the
component parts of those models move together in the proper way. For example,
a 3D cast member might contain two model resources relating to a car. These
could be the geometry for a car body and the geometry for a car wheels.
If the wheels of the car (all using the single model resource) are defined
as children of the car model, then moving the car will cause the wheels
to be moved with the car in the expected manner. If no parent-child relationship
is defined between the car and the wheels, moving only the car will cause
the wheels to be left behind in their original position in the world. The
hierarchical parent-child relationships are vital for interactive 3D. By
modifying the transform of the parent, all the children of that parent will
respond in the same way.