Torque Animation CIS 487 587 Bruce R Maxim UM Dearborn 01 14 19 1 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 01 14 19 2 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 01 14 19 3 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 01 14 19 4 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 01 14 19 5 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 01 14 19 6 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 01 14 19 7 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 01 14 19 8 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 01 14 19 9 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 01 14 19 10 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 01 14 19 11 Exporting from Maya The Maya2DTS Reference Guide located at the following URL http www dannyngan com torque maya2dts A file pack containing the files referenced is located at the following URL http www dannyngan com torque maya2dts m aya2dts filepack zip You need a copy of Maya to make use of the plug ins and examples 239 CIS 01 14 19 12 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 01 14 19 13 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 01 14 19 14 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 01 14 19 15 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 01 14 19 16 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 01 14 19 17 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 01 14 19 18 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 01 14 19 19 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 01 14 19 20 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 01 14 19 21 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
View Full Document
Unlocking...