Credits
How to install
User Manual

   Using subsequent behaviors in the score
  Holding on a frame
  Setting up behaviors with dynamic parameters
  Entering precise values
  Managing a lot of behaviors
  Best practices
  Using triggers and UI behaviors together

  Finding the right behavior instance number to call a handler
  Using the Chrome Lib bitmaps

Focus on some of the key behaviors
Compatibility

Legal Notice



Credits

Behavior Library by Karl Sigiscar © 2001-2006:
e-mail: info AT chromelib DOT com

With contribution from Christophe Leske.

"First Person Camera" behavior by Pierre Leroy.
"Explosion Particle FX" and "EyeCandy FX Set". Particle code by Christophe Leske.

Thanks to Christophe Leske, Lionel Lemoine, Tom Higgins, Miriam Geller,
George Fox, Craig Goodman and Amy Wong for their support.

<< back to top


How to install

Extract the Chrome Lib zip archive in the Libs folder of your Director install folder:

Either C:\Program Files\Macromedia\Director 8.5\Libs\
or C:\Program Files\Macromedia\Director MX\Libs\
or C:\Program Files\Macromedia\Director MX 2004\Configuration\Libs\


Next time you launch Director, a new entry - Chrome Lib -
will appear in the Director Behavior Library.

There are 6 sections : 3D, Flash, QuickTime, Sound, Navigation and Parent Scripts.

Developers can use the parent scripts in the Parent Scripts section.
Drag'n'drop the parent script directly in your projects' internal cast
and write an initialization script to create instances.

If you cannot see all the available behaviors in the Chrome Lib, you may scroll
clicking the down arrow at the bottom or uncheck Show Names in the library
options. Only the behavior icons will be visible then, freeing up a much needed space
on a 15" or 17" display.


 
The Chrome Lib in the Library panel under Windows.

<< back to top


User Manual


Read the Chrome Lib tutorials on macromedia.com


Using subsequent behaviors in the score

It is very useful to assign differents sets of behaviors to the
same 3D sprite overtime in the score. For example, a first
occurrence of the sprite could have a "Load models into the scene"
behavior attached to it. Then, a second occurrence of the same
3D sprite in the score could have a "Model Position" behavior
attached to it. Finally, a third occurrence may have an
"Interpolate model to transform" attached. There can be as many
subsequent occurences of the same 3D sprite in the score, allowing
you to create as many sets of behaviors as you need for your
project. The Property inspector in Director allows you to see
what behaviors are attached with each occurrence of the 3D sprite
in the score.



<< back to top


 Holding on a frame

Most "Chrome Lib" behaviors require that you hold
on a frame so they can work correctly.

To this end, use the "Hold on Current Frame" behavior
in the Director "Navigation" behavior library.

<< back to top


Setting up behaviors with dynamic parameters

Every so often, you want to set up a behavior whose one of the parameters
is created on the fly. For example, you want a target camera to
follow a model that is loaded using the "Load Models into the Scene"
behavior. Run the movie once. The model is loaded into the scene.
Then assign the extra behavior acting on this model to a new occurence
of the same 3D sprite in the score. Restart the movie from the beginning. The new
behavior has been assigned to the model loaded on the fly.

<< back to top


Entering precise values

If you cannot enter the exact values you want using the sliders in some behaviors,
you can still type the precise value using the text field for each parameter in
the behavior pane of the property window. The lowest value you can enter is 0.01



<< back to top


Managing a lot of behaviors

The Behavior tab in the Property Inspector only allows you to see a limited number
of behaviors. For advanced projects, you may have dozens of behavior instances.
In that case, you may look into the Behavior Inspector tab of the Code panel instead,
as it allows to see much more behaviors.



<< back to top


Best practices for W3D files

Before exporting to the Shockwave 3D format in your 3D package:

- Name your models, shaders, lights and cameras so they make sense
once in Director when you set the parameters in the Chrome Lib behaviors.


- Group the bipeds and their respective mesh so you can get
their animation playing in Director.

- Remember each group will be turned into a model at export time.

- Set the pivot point of each model so it rotates correctly about its axis
and is placed correctly when positionned or when its transform is interpolated.
E.g the pivot point of a door should be set at the level of the hinge and that
of a tree or building should be set at its center at the base.

- For transparency, remember to use 32 bit textures with an alpha channel
and to set the Texture Render Format to #RGBA8888 in Director.


<< back to top


Using triggers and UI behaviors together

Many behaviors in the Chrome Lib have built-in triggers to activate an action
immediately (none), when the user presses the mouse button,
when the user presses any key or when a handler is called. In the latter case,
select wait. The behavior will wait for one of its handlers to be called by one
of the UI behaviors to get started.

UI behaviors allow you to create an interface in order to perform
actions on the scene by calling handlers on behaviors already assigned
to the W3D sprite.


The interface elements can be either:

- outside the 3D scene:
Button, Text, Bitmap or Flash sprites with the Behavior Control from UI behavior

- on top of the 3D scene:
Overlay Button UI, Overlay Slider UI and Overlay Knob UI

- inside the 3D scene:
3D Rollover Model UI


Also, it is to be noted that:

- 2D UI elements can be used to control bitmap overlays and text overlays.
- 2D UI elements can control 3D models.
- 3D UI elements can be used to control bitmap overlays and text overlays.
- 3D UI elements can control 3D models.
- A 3D UI element can control itself

As you can see, the use of UI elements is not limited
to a 2D interface controlling 3D models.

<< back to top


Finding the right behavior instance number to call a handler



<< back to top


Using the Chrome Lib bitmaps

The Chrome Lib includes a number of bitmaps. There is the Expl 32 bit bitmap
with alpha channel for particle FX, the Slider Background, Slider Bar
and Slider Knob bitmaps for the Slider UI behavior and the Knob 32 bit
bitmap with alpha channel for the Knob UI behavior. Drag'n'drop the
relevant bitmap(s) in the internal cast prior to using the corresponding
behavior. Alternatively, you may use your own bitmaps by importing
them into the internal cast.

<< back to top


Focus on some of the key behaviors



   Collision Trigger Action

New to version 4.0 , this behaviour handles collision detection between two models and triggers an action on a target behaviour when a collision occurs. The parameters allow you to choose between precision and performace.

<< back to top


   Walkthrough with Collisions

New to version 4.0 , this behaviour allows you to walk through a 3D scene while detecting collisions. You can set the bounding radius of the camera used so that collisions occur closer to or farer from the camera.

<< back to top


   Overlay Color Picker UI

New to version 4.0 is the Overlay Color Picker UI behaviour. It displays a color swatch that when rolled over, makes a Color Picker component appear. The user can see the effect of the color applied to a model or shader while rolling over the Color Picker. When clicked, the current color is selected and permanently assigned to the target model or shader. To this end, this behaviour can control any behaviour that implements the setColor() handler:

- Diffuse Color
- Diffuse Color Tweening
- Emissive Color
- Emissive Color Tweening
- Light Color
- Light Color Tweening

or your own custom behaviour with a setColor() handler.

<< back to top



  Play Video for Shockwave

Also new to version 4.0. Allows you to play a Flash Video or QuickTime video or Real Video as a texture on a given shader with excellent playback performance. You can either import a .rm or .ram RealVideo® file, a .mov or .qt QuickTime® file or a .swf Flash file in the Internal cast or stream a video from a HTTP server. The start() handler allows an interactive trigger of the video. Using either the Overlay Button UI or Behavior Trigger from UI behavior, you can call this handler. You could
create a selection of videos to be displayed on a same shader when the user clicks on buttons created with the Overlay Button UI behavior. Each button would call the start() handler on an instance
of the Play Real Video® behavior, each with a different set of parameters, pointing to a different video.

Other handlers callable on this behavior:
stop (), pause(), resume()

<< back to top


  Setting up the Texture Render Format

For textures with alpha channel, whether they are mapped on objects
or displayed as overlays to render properly, you must force Shockwave 3D
to render the textures in 32 bit mode. To this end, use the
Texture Render Format behavior and set it up to RGBA8888.

NB: opacity masks are not supported by Shockwave 3D. If you setup an opacity
mask in a channel in your 3D package, the alpha channel will not be exported. You
must include the opacity mask in the texture. I.e, instead of having a 24 bit texture
+ an 8 bit opacity mask, you must create a 32 bit bitmap with an 8 bit alpha channel
and map it as a texture on your model.

Director accepts PSD files with alpha channels so you don't even have to export
your 32 bit bitmaps to PNG, TARGA or TIFF format. You can import them directly
(just drag'n'drop them from Explorer to the internal cast). Also, check out the
Convert to Alpha standard Xtra feature in Macromedia Fireworks, which allow
you to convert any image to an alpha channel.

Here are two methods to create textures for an overlay, depending upon its
usage:

* Easiest way to create an opacity mask
(an overlay with a shape, i.e non-rectangular)

Create a new image in Adobe Photoshop, add a new layer, draw in it, disable the
background layer visibility and save. Director imports PSD files with an alpha channel.
Another way of creating a texture bitmap for an overlay with a shape is to
create a symbol in Macromedia Flash, resize the stage to the size of the
symbol and select File > Export Image to create a 32 bit PNG.


* Easiest way to create a texture with 256 levels of transparency
(see-through overlay)

Open an existing image in Macromedia Fireworks (e.g a photo) or create a gradient.
Select it and select Xtras > Convert to Alpha or Filters > Other > Convert to Alpha
and save. Director imports PNG files with an alpha channel.

The overlay transparency depends both on the alpha channel and the blend property.

An alpha channel can be used for three purposes:

1- Giving a sharp shape to a texture (opacity mask)
2- Giving a smooth shape to a texture (as for a lit light bulb)
3- Creating a transparent texture with 256 levels of transparency from 0 to 255

The transparency level can vary within the texture, e.g a gradient
or photo used as an alpha.


NB: The regpoint of an overlay is at its top left hand corner for position and scale
and at its center for rotation. If you want to create e.g a classic speedometer with
a rotating needle, create a transparent 32 bit bitmap of the needle with an alpha channel
and leave some blank space around the needle so that the needle's bottom end is
at the center of the bitmap.

In order to get crisp texture display for overlays:

- Use the Texture Quality behavior in order to set texture quality to high.

- Finish your project using Texture Render Format as the last behavior
in order to set texture render format to RBGA8888. This way,
all existing textures, including the ones created on the fly
at runtime for overlays will be affected.

- Also, it is best to use powers of 2 for textures width and height:
16 x 16, 32 x 32, 64 x 64, 128 x 128, 256 x 256, 512 x 512.

<< back to top


  Behavior Trigger from UI

This behavior allows you to control behaviors at runtime
by calling a handler on a behavior already assigned to a given W3D sprite.
You do not need to code anymore in order to control behaviors !

As any other sprite, a W3D sprite has a script instance list at runtime.
It is a list of the behaviors that have been dragged and dropped onto it.
You can access the script instance list in order to reach a given behavior
and call one of its handlers in order to control the behavior directly as
opposed to using the behavior's predefined controls (e.g pressing a key).

- Check the Behavior tab in the Property Inspector

- If you have at least one behavior attached to your W3D sprite,
the index of the behavior you want to control is the one given by
the order of the list.

You can then assign the Behavior Trigger from UI behavior to either an image,
a button or a text sprite in the user interface of your project e.g to switch
to the previous or next camera when the button is pressed
('Change Camera' behavior): the handler call would be respectively
previousCamera() and nextCamera().

<< back to top


 3D Rollover Model UI

This behavior allows you to control behaviors at runtime
by calling a handler on a behavior already assigned to a given W3D sprite
when the user clicks on or rolls over a model.

<< back to top


  Overlay Button UI

This behavior allows you to display a multistate button or a group of buttons
on top of the 3D scene. The different states are created from bitmaps present
in the internal cast: normal, rollover, pressed and selected.

When the button is pressed, the behavior calls a given handler from another,
already assigned behavior. In this respect, this behavior is similar to
Behavior Trigger from UI.

<< back to top


  Overlay Push Button UI

This behavior allows you to display a button on top of the 3D scene with two states: ON and OFF
and their corresponding actions
. The two states are created from bitmaps presentin the internal cast.

When the button is pressed, the behavior calls a given handler from another,
already assigned behavior. In this respect, this behavior is similar to
Behavior Trigger from UI.

<< back to top


  Overlay Slider UI

This behavior allows you to display a horizontal slider on top of the 3D scene.

When the user drags the slider knob, the behavior calls a given handler from another,
already assigned behavior. In this respect, this behavior is similar to
Behavior Trigger from UI.

For example, for the 'Light Color' behavior, the handler call would be:
setLightLevel() or setRed() or setGreen() or setBlue().

For example, for the 'Diffuse Color' behavior, the handler call would be:
setRed() or setGreen() or setBlue().

For example, for the 'Model Transform' behavior, the handler call would be:
setXRotation() or setYRotation() or setZRotation().

For instance, you could define a value range from 0 to 255 or from 0 to 360.
The handler will then be called with the current slider value.

<< back to top


  Overlay Knob UI

This behavior allows you to display an overlaid knob user interface element on top of the 3D scene.

When the user drags the knob, it rotates and the behavior calls a given handler from another,
already assigned behavior. In this respect, this behavior is similar to
Behavior Trigger from UI.

For example, for the 'Light Color' behavior, the handler call would be:
setLightLevel() or setRed() or setGreen() or setBlue().

For example, for the 'Diffuse Color' behavior, the handler call would be:
setRed() or setGreen() or setBlue().

For example, for the 'Model Transform' behavior, the handler call would be:
setXRotation() or setYRotation() or setZRotation().

For instance, you could define a value range from 0 to 255 or from 0 to 360.
The handler will then be called with the current knob value.

<< back to top


  Behavior Control from Flash UI

This behavior allows you to control behaviors at runtime from your Flash user interface
by calling a handler on a behavior already assigned to a given W3D sprite.
You can assign very simple ActionScript code (one line) to a frame, a button
or a component to
call a handler on a 3D behavior.

<< back to top


  Flash Control from Model

This behavior allows you to jump to a frame in a Flash sprite
when the user clicks on or rolls over a given model. This allows you to add
contextual 2D information/animation to a 3D scene which is very useful
to build an application. Basically, it means controlling Flash from Shockwave 3D.

<< back to top


  Model Icon Drag Action UI

This behaviors allows you to call a handler from a behavior by dropping
a symbolic representation of a given source model on a given target model.
When dragging begins, the dragged model is turned into an icon.
When this icon is dropped onto the target model, the action is triggered.
A target indicator displayed at the top left corner of the icon tells
whether the model currently being hovered is the target.

<< back to top


  Play Real Video®

This behavior allows a streaming or local Real Media® video cast member
to be played as a texture on a given shader. The startVideo() handler
allows an interactive trigger of the video. Using either the Overlay Button UI
or Behavior Trigger from UI behavior, you can call this handler. You could
create a selection of videos to be displayed on a same shader when the user
clicks on buttons created with the Overlay Button UI behavior.
Each button would call the startVideo() handler on an instance
of the Play Real Video® behavior, each with a different set of
parameters, pointing to a different video.

Other handlers callable on this behavior:
stopVideo(), pauseVideo(), resumeVideo()

<< back to top


  Go to URL with Rollover

This behavior allows you to create a 3D based navigation interface.
When the user rolls the mouse over a given model, it is highlighted.
When the user clicks, it links to a given URL, either targetting
the current window, a given window, a given frame
or by opening a popup window.

<< back to top


Compatibility

The Chrome Lib is compatible with Macromedia Director 8.5, 8.5.1, MX and MX 2004
under Windows and MacOS X. The Chrome Lib has not been designed to work
together with the Trigger behaviors of the standard Director 3D library.

Forecasting and managing the interdepencies between the existing behaviors in the
Chrome Lib and your own code is something impossible to achieve. There are
necessarily side effects you will have to deal with. You have to understand each
individual behavior can show you the code to achieve an action or an FX, but it is
up to you to blend this code with yours so they work together. Behaviors only
projects should be kept simple. If your project is complex, it is best to use parent
scripts instead. Existing behaviors can be turned into parent scripts.
Some of the FX available in the Chrome Lib are also available as parent scripts.

<< back to top

 

Legal Notice

Karl Sigicar grants you ("Licensee") a non-exclusive, royalty free, license to use,
modify this software - Chrome Lib 3.21 - in source code form, provided that:

i) You do not redistribute the software
ii) This copyright notice and license appear on all copies of the software
iii) Licensee does not utilize the software in a manner which is disparaging to Karl Sigicar


This software is provided "AS IS," without a warranty of any kind. ALL
EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
NON-INFRINGEMENT, ARE HEREBY EXCLUDED. KARL SIGISCAR AND ITS LICENSORS SHALL NOT BE
LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL Karl Sigicar OR ITS
LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
OR INABILITY TO USE SOFTWARE, EVEN IF KARL SIGISCAR HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

This software is not designed or intended for use in on-line control of
aircraft, air traffic, aircraft navigation or aircraft communications; or in
the design, construction, operation or maintenance of any nuclear
facility. Licensee represents and warrants that it will not use or
redistribute the Software for such purposes.

RealVideo® is a registered trademark of RealNetworks, Inc.

QuickTime and the QuickTime Logo are trademarks of Apple Computer, Inc.,
registered in the U.S. and other countries.

Adobe, Adobe Flash™, Adobe Director™ and Shockwave™
are registered trademarks of Adobe Systems Incorporated in the U.S. and/or other countries.

Chrome Lib for Adobe Shockwave 3D
Copyright ©2001-2010 by Karl Sigicar. All Rights Reserved.

<< back to top