Torque Game Engine DocumentationVersion 1.3.x |
The following tutorial will walk you through setting up a very simple shape in Maya and exporting it for use in the Torque Game Engine. Please note that this is not a Maya how-to. For more information on the general use of Maya, refer to the help files that are included with the Maya installation.
Keep in mind that this tutorial is designed to introduce you to the basic tools and techniques used to setup and export shapes for the Torque Game Engine. It is not designed to show you how to get a shape working in your game. Characters, vehicles, and weapons are obviously more complex than the simple shape in this tutorial and will require very specific types of objects and naming conventions in order to function properly. Please refer to appropriate sections in this document for more information.
The File Pack contains files that you may use during these tutorials. simpleShapeBase.mb, simpleShapeDetails.mb, simpleShapeCollisions.mb are the finished versions of the Maya scene files that are ready for export. simpleShapeAnimation.mb contains an animated object that is ready to be set up for export. simpleTexture.png is the texture for all scene files.
In the Inputs section of the Channel Box, select polySphere1 to bring up the sphere's attributes. Set its subdivisionsAxis and subdivisionsHeight to 16.

Press 6 on the keyboard to view the model in shaded mode. Press 4 to view as wireframe again.

In the Create Bar on the left, select Lambert. lambert2 is created in Materials section.

Double-click lambert2 to open its Attribute Editor.

Click the File button in the 2D Textures section. The file node's attributes are now displayed in the Attribute Editor.

In the file dialog, set the Files of Type dropdown menu to Best Guess. Then choose simpleTexture.png from the file dialog.

Close HyperShade.

You are now ready to export the shape.
Open HyperGraph (Window > HyperGraph). What you see should look like this:

The Embed Shape button created a hierarchy for your shape which will allow it to export. The Register Details button created a detail marker that matches the detail resolution on simpleShape2. The detail marker tells the exporter that there is a detail mesh that should be exported.
The base and start shapes and the detail marker can be created manually as well by creating empty groups (Create > Empty Group) then renaming and parenting them accordingly.
In order to view shapes in the ShowTool, the shape and texture files must reside in a directory inside the Torque project.
Copy simpleShape.dts and simpleTexture.png into a shape directory in the Torque project. If you are using the demo, you can place the files in demo\data\shapes inside the Torque example directory.
The ShowTool can be accessed by putting the argument -show when you launch the application. This can be done from the command line, but it is easier to just add the switch into a shortcut.

After launching the ShowTool, you will see a black screen with several buttons on the left-hand side.

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.
W: zoom in
S: zoom out
A: rotate left
D: rotate right
E: rotate camera up
C: rotate camera down
Z: rotate camera left
X: rotate camera right
When you are finished viewing the shape, click Quit to close the ShowTool.
Continue working with simpleShapeBase.mb from the previous section.
Check Duplicate Input Graph. Click the Duplicate button to make a copy of simpleShape128 with inputs.

Open HyperGraph. What you see should look like this:

Other useful information is contained in the panel, including which detail level is being displayed and the polygon count.
Press the Detail Control button.
