STRATA LIVE 3D CX » Tutorials
In the Attachments section, to the right, you will find two master models:
BallInBox2a.XMM is the model we're starting with
BallInBox2b.XMM is the model we end up creating
1) Open the Model
Download the BallInBox2a model from this article's attachments section, and drag it into Strata Live 3D.
2) Sequence Clean-up
Use the Panels > Sequences & Views menu item to open the Sequences and Views panel. Find the sequence called "Top" and click the Edit button to its right.
This opens a dialog which shows each waypoint of the sequence. Notice that there are 7 waypoints which take the top from completely closed to completely open. If you click the Jump To button for each of these, you will see that only the first and last waypoints are really necessary. Select the second waypoint, then click the Delete button at the bottom of the list a few times until you just have the first and last waypoints remaining.
Now select the first waypoint. Change the Waypoint Name to "Close"
Select the last waypoint. Change the Waypoint to "Open". (Notice that you can adjust the actual opening angle, if you need to.)
Click the OK button to end editing the sequence waypoints. Notice that the slider still takes the top through its entire range of motion, and the combo box shows only two options, Close and Open.
Now click the Edit button for the Ball sequence. In this case, the intermediate waypoints are important, because they are not just linearly interpolating the first and last ones. In this case, we'll only name the first and last waypoints, since those are the conceptually important ones.
Select the first waypoint, and change the Name to "In".
Select the last waypoint, and change the Name to "Out." Click OK to close the waypoint editor.
3) Create the Box Open Script
Use the Insert > Script... menu item to create a new Script. We will not be appending any script to start with, so just cancel out of that dialog. Next, we are allowed to select a Track to get started. Select the Top track.
Notice that a small remote has appeared in the 3D window. Click the + button on the remote twice, to make the script 2 seconds long.
Right click the top of the box, and drag the Top control to the outside of the control disc.
Notice that a new keyframe was automatically created on the timeline. Alternately, you could have right-clicked on the timeline, and used Set To > Open to set a keyframe to open the box.
Click the Play button in the remote to see the script execute.
Click the Rename button in the Scripts Panel, and name the script "Box Open". Note that by convention, scripts should be named by the part the operate on, followed by a description of what they do. This convention is assumed by the web export interface, to automate assigning scripts to control buttons.
Note that it only makes sense to run the Box Open script if the box is Closed. This is called a pre-condition, and we should set the preconditions accordingly, to facilitate user interface automation. Click the Edit Preconditions button, and change the Top sequence to Close. This means that the Box Open script is only available when the Top is Closed. Click OK to dismiss the dialog.
4) Create the Box Close Script
Use the Insert > Script... menu item to create a new Script. This time we will start from an existing script: the Box Open script we just created.
Uncheck the "Respect Preconditions" box to allow display of the Box Open script, regardless of whether the box is currently closed. Select Box Open from the drop-down.
Check the Reverse Script checkbox. This will append the Box Open script, only reversed.
Notice that some built-in logic automatically comes up with a reversed name. Float your mouse cursor over the Edit Preconditions button, and notice that the preconditions are also automatically reversed (in order to Close the box, it must currently be Open).
5) Preview the Scripts
Use the Panels > Preview Scripts menu item to enable the script preview panel. Only those scripts that have matched pre-conditions are enabled.
Click the Box Open and Box Close scripts to confirm that they work the way you want, and that they have the right pre-conditions (only one is enabled at a time!).
6) Create the Ball Out Script
Use the Insert > Script... menu item to create a new Script. Cancel the Append dialog, and choose the Ball track.
Right Click the first waypoint on the Ball track, and choose Set To > In.
Click the + button (to the right of the Duration display) twice, then use Set To > Out to create the second key frame. (Of course, you could have used the Remote in the 3D window, like we did for the box top.)
Click Rename, and change the name to Ball Out.
Click Edit Preconditions, and change the Ball precondition to In.
Before the ball can come out, the box needs to be open. Click the Edit Befores button, then Add..., and select Box Open.
7) Create the Ball In Script
Use the Insert > Script... menu item to create a new Script. Uncheck Respect Preconditions, select Ball Out, and check Reverse Script.
The name and preconditions are set correctly, but as with taking the ball out, we need to make sure the box is open before we put the ball in the box. Click Edit Befores, then Add..., then Box Open.
8) Preview the Scripts
Use the Panels > Preview Scripts menu item to preview these new scripts. Try running the scripts in this order, to get a feel for the power of Preconditions & Befores...
Init
Box Open
Ball Out
Box Close
Ball In
Box Close
Ball Out
9) Generate a Web Tour
Create a directory on your desktop to hold our first web tour.
Use the Export > Web Tour > Study Scene from Outside menu item to create the web tour. Your browser should open automatically.
Note that if you are using Windows XP SP2, a yellow bar will warn you when you run Java applets from your local drive. This can get really annoying, really fast. To turn this off, use the Internet Explorer menu item Tools > Internet Options... > Advanced (tab) > Security (section) > Allow active content to run in files on My Computer (check this option).
10) Save!
Use File > Save to save your work. In the next tutorial, we'll adjust the size of the model, and tidy up the web display a bit.





