3D Animation Example

243 views
Skip to first unread message

Harry King

unread,
Dec 7, 2016, 2:28:55 PM12/7/16
to Jaamsim Users Discussion Group
JaamSim Users,

The attached model is an example of JaamSim's 3D animation system. Note that it is necessary to copy both files to the same directory on your computer. Start the model to show how the various animations work together smoothly.  You can rotate and zoom in and out to examine the model as the animation is running.

Here is how it works:

The Collada file “cranes.dae” includes a number of separate animated actions that were created in 3DS Max using the “animation layers” feature. The Collada file was exported from 3DS Max using the OpenCollada plugin and imported to JaamSim using the standard procedure (File > Import > 3d Assets). The animations were retained automatically throughout this process thanks to our contribution to the OpenCollada project.

You can see a list of the animations for a ColladaModel by examining the output named “Actions” in the Output Viewer. The animation actions for the imported ColladaModel “cranes-model” are: Boom1, Boom2, Hook1, Hook2, TransY, and TransX.

The Actions keyword for the ColladaModel is used to link the named animation actions with Output names for the "cranes" DisplayEntity. The following input to the Action keyword connects the action named “Boom2” with a custom output for the cranes DisplayEntity that is also named “Boom2”:

     { Boom2 Boom2 }

The Boom2 output for the cranes DisplayEntity is created using the following input to its CustomOutputList keyword and assigned the output of a SineWave object for this demo:

     { Boom2 [SineWave1].Value DimensionlessUnit }

Note that actions expect a dimensionless number equal to the time in seconds for the 3DS Max timeline. The range of the motion and the relationship between the motion and the timeline value is whatever was set up in 3DS Max.

For many applications, the DisplayEntity sub-class will already have suitable outputs to control the animations. In this case, there would be no need to define custom outputs, and the existing outputs could be connected directly to the animations using the Actions keyword for the ColladaModel.

One of the powerful features of JaamSim's animation system is that many separate DisplayEntities can share the same ColladaModel and manipulate the animations independently. For example, you could have one ColladaModel for a car with animations for rotating the wheels, turning the steering, opening the doors, etc. One hundred separate cars could use this one ColladaModel and each could still be able to move on roads, steer, park, open their doors, etc. independently from one another.

Harry
Animation Example.cfg
cranes.DAE
Reply all
Reply to author
Forward
0 new messages