Download presentation
Presentation is loading. Please wait.
1
CIS 487/587 Bruce R. Maxim UM-Dearborn
Torque Animation CIS 487/587 Bruce R. Maxim UM-Dearborn 1/12/2019
2
General Method - 1 Construct a skeleton that corresponds to the components of the model Attach the skeleton to components (this process is called rigging) Create sequence of keyframes (e.g. skeleton poses) 1/12/2019
3
General Method - 2 The Torque engine performs animation by calculating the positions of the meshes in the model from the position and rotation of the nodes (i.e. the bone joints) based on where they appear in the animation time line 1/12/2019
4
DTS and DSQ The animation sequence can be embedded with the model in the DTS file The the sequence information can be separated from the DTS model and stored in a DSQ file (allowing two different animations to be played for the same model – known as blended animation) 1/12/2019
5
What is DTS? Unlike 3D modeling packages or motion pictures, a game engine must be able to render huge amounts of geometry and effects in real time. In order to do this, many shortcuts are taken in the rendering process to ensure optimal framerate. DTS is a model format designed to be both flexible and optimized for rendering in the Torque Game Engine. 1/12/2019
6
DTS Works Well Small complex objects (such as rocks and weapons and can be attached to players) Character models (Characters can be animated using bone structures). Vehicles (Players and weapons can be mounted on them and controlled by players). Animated details to be added to structure (rotating radio towers, turrets, and other dynamic objects). 1/12/2019
7
DTS Works Poorly Buildings and other large objects (DIF format much better suited for this purpose) Objects requiring complex or precise collision. Objects that will regularly take up several screen lengths (split them into smaller objects or use DIF). 1/12/2019
8
Torque Animation Sequences - 1
Root – standing Run – fast forward Walk – slow forward Back – running backward Side – strafing Look – right arm (or weapon) follows gaze Head – looks up or down Fall – character in air 1/12/2019
9
Torque Animation Sequences - 2
Land – after a fall Jump – while running Death1 – first of 11 death poses Looksn – look, hold weapon close Lookms – look with loose arms Scoutroot – player riding astride something Headside – player turning head side to side Light_recoil – reaction to firing 1/12/2019
10
Torque Animation Sequences - 3
Sitting – like in a car Celsalute – salute when Ctrl-S pressed Celwave – wave when Ctrl-W pressed Standjump – another jump pose Looknw – look weapon with arms loose Note: you can script others if you wish 1/12/2019
11
Exporting to Torque Once the animation model is rigged and sequenced in Maya, 3D Studio Max, or Milkshape the model needs to be exported as a DTS file to use it in Torque The exporter allows you create several collision meshes that all need to be named Collision (you are not required to have any) Keyframe sequence information is defined during DTS export 1/12/2019
12
Exporting from Maya The Maya2DTS Reference Guide located at the following URL: A file pack containing the files referenced is located at the following URL: You need a copy of Maya to make use of the plug-ins and examples (239 CIS) 1/12/2019
13
Installation Follow the directions for the Maya plug-in installation from the Torque documentation Likewise follow the Maya configuration instructions to allow the use of the dtsUtility Maya preference settings for Torque use Unit = 1 meter (not 1 cm) FPS = 30 (not 24) Define a project workspace to save the exported models (Maya does not require this Torque does) 1/12/2019
14
Example - 1 Create the simpleShape using Maya
Create the material for simpleShape Export simpleShape as a DTS file Put the simpleShape project file in your Torque game data shapes folder (need simpleShape.dts and simpleTexture.png) Use the Show Tool to view the shape torqueDemo -show 1/12/2019
15
Example - 2 Click the Load Shape button, select simpleShape.dts, then click the Load button. You can navigate around the shape by using the W, S, A, D, E, C, X, and Z keys. The Level Detail button brings up a slide bar that allows you to explore different resolutions (the key allows detail adjustment by distance) Use the Quit button to exit 1/12/2019
16
Collision Details - 1 Custom collision shapes can be created by assigning a negative detail number to the shape and creating a corresponding detail marker. Shapes with negative numbers will export but not draw. Because Maya does not allow dashes ("-") in object names, underscores ("_") must be used. 1/12/2019
17
Collision Details - 2 The Torque Game Engine presently uses detail markers named Collision_# with the mesh shapes named Col_#. The shapes must be convex hulls (no concave surfaces). Keep the detail meshes as low in polygon count as possible, because collision can be processor intensive. Vehicles are limited to ONE collision mesh for the collision shape. 1/12/2019
18
Collision Details - 3 Here are some of the naming conventions:
Collision_1 through Collision_9: These are collision markers. Col_1 through Col_9: These are the actual collision meshes. LOS_9 through LOS_15: Markers for line of sight, or "bullet", collision shapes. LOScol_9 through LOScol_15: Geometry for line of sight collision. 1/12/2019
19
Materials and Textures - 1
Creating textures for Torque shapes is fairly straightforward. You can use any paint/image editing program to create texture maps and then apply them to shapes in Maya (e.g. GimpShop) All shapes must have actual image files connected to the material's Color attribute. Procedural textures are not supported. 1/12/2019
20
Materials and Textures - 2
Torque supports JPG, TGA, and PNG file formats. Note: PNG support in Maya 5.x for Windows is provided by IMFPng plugin included in File Pack. Image file dimensions must be powers of two (e.g. 256x256, 64x64, etc). Textures do not have to be square (e.g. 64x128 is acceptable). 1/12/2019
21
Materials and Textures - 3
To make an object transparent, the object texture must have an alpha channel. PNG and TGA support them; JPG files do not. Two-sided materials are supported by adding a custom attribute twoSided to the object. Visibility animation is supported by adding a custom attribute named vis to the object during export. Maya's visibility attribute is ignored. 1/12/2019
22
Sequence Nodes - 1 Sequence nodes tell the exporter how to export animation data over a given range of frames in Maya (required if animation is to be exported). The sequence node contains a variety of information such as the name of the animation sequence, start and end frames, cycling and blend information, and frame rate. 1/12/2019
23
Sequence Nodes - 2 The naming convention for sequence nodes is Sequence_name. Sequence nodes must always be prefixed with Sequence_, otherwise they will not be exported. Sequence nodes can be created and edited manually, but it is far easier to create them from the dtsUtility window. 1/12/2019
24
Character Basics - 1 Deformable meshes are supported by the exporter and the Torque Game Engine through the use skeletal animations. The vertices of the mesh are assigned weights to the skeletal nodes (joints), and the transforms of the skeletal nodes then deform the mesh in real time. They are edited in Maya and exported. 1/12/2019
25
Character Basics - 2 The one method in Maya is:
to create multiple sequence nodes in the Maya scene file, name each sequence accordingly and set the start and end frames to match the frames during which each animation occurs. Then, the entire scene can be exported as a single DTS file. This method is fairly simple, but it does not allow for customization of export options for each individual sequence. 1/12/2019
26
Character Basics - 3 A second method in Maya is:
to save each of the animations as individual Maya scene files. Each Maya file with animation will have a single sequence node corresponding with the desired animation. The Maya file with the base shape will contain all of the meshes and nodes but will not have any sequence nodes. Each file will be exported individually: the base shape will be exported as a DTS file, and the animations will each be exported as DSQ files. 1/12/2019
27
Character Basics - 4 All of the DSQ files can be merged in the engine using a .CS script file. This method is obviously more complex, but it does allow for a greater degree of customization. For this example put the simpleBox.CS script in the same directory as its DTS and DSQ folders 1/12/2019
28
simpleBox.CS Script datablock TSShapeConstructor(SimpleBoxDTS) {
baseShape = "./mySimpleBox.dts"; sequence0 = "./mySimpleBox_bendFrontBack.dsq bendFrontBack"; sequence1 = "./mySimpleBox_bendSide.dsq bendSide"; sequence2 = "./mySimpleBox_look.dsq look"; sequence3 = "./mySimpleBox_jumpForward.dsq jumpForward"; sequence4 = "./mySimpleBox_jumpUp.dsq jumpUp"; sequence5 = "./mySimpleBox_fallBack.dsq fallBack"; }; 1/12/2019
29
Viewing in ShowTool - 1 Launch the ShowTool.
Click the Load Shape button. Open mySimpleBox.dts from the shape list. simpleBox will load and the first animation on the list (bendFrontBack) will be playing. Click the Thread Control button. 1/12/2019
30
Viewing in ShowTool - 2 The Thread Control window allows you to playback and test all of the animations in your shape. The sequences list displays each animation for your shape using the name and order that was designated in the .CS file. You can view all of the shape's animations by clicking through the list of sequences. 1/12/2019
31
Viewing in ShowTool - 3 You can start and stop the animation as needed, scrub through the animation using the slider, and view different transition methods. You can also create additional threads to layer animations. Even though this was a very simple character, the overall concepts will apply to practically any character created in Maya. 1/12/2019
32
Viewing in ShowTool - 3 The Maya2DTS Reference Guide contains more detailed information about creating shapes and animations for Torque. 1/12/2019
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.