Building a new character model
Our third tutorial will be to build a new character shape from scratch.
Getting Started
Our goals for this tutorial are to:
- Get an understanding of the naming and object hierarchy used by the Exporter for character shapes.
- Create a basic character shape
- Export it!
- Skin it
Naming objects in the Shape
The naming convention for player models are different to those used for
simple shapes. Because the player models have been built using Character
Studio's BIPED plugin, the naming hierarchy makes use of the default name
generated by the plugin (denoted by BIP before each of the objects)
The BIPED plugin generates a skeleton upon which meshes can be linked
to achieve a skin layer to the model. Don't rename any of the BIP objects
otherwise your model will have problems exporting. Step-by-Step building the Character Shape
In 3DS MAX start a new scene. Follow each of the steps to create a rough
model of your character. Because of the number of boxes to create you will
have to use your own judgement on look, feel and sizes. I would recommend
exporting at several points through out the making of the model, and view
it under theTorque Game Engine model viewer.
NB: Currently the model seems to float about 2-3inches above the terrain
in the Torque Game Engine, I believe it has something to do with detail described
in theMAX2DTSExporter Documentation
"Likewise, ground animation is based on the animation
of the bounding box. So if you want to export a running person, you would place
the bounding box around the person at time 0, with the origin of the box at
the persons feet. As the person runs, you would animate the bounding box to
keep pace with the person. Note: the easiest way to do this would be to link
the bounding box to the hips, and set it to only inherit y-position." Unfortunately, I can't get this to work!
A copy of the "player_box.max" is available under
tge/tutorials/simplecharacter/ directory.
|
| 9 Steps to build the Character shape
|
| 1.
|
Create the BIPED skeleton
- select the biped object from the (Command Panels -> Create -> Systems -> Biped)
- change the number of "Spine Links" to 3
- create a biped position it at 0,0,0 and make it's height about 2.00 GU, or roughly (63 inches, 5'4)
|
| 2.
|
Create the Bounding box
- create a box
whose name is "bounds", position so it surround the entire shape. The box
must encompasses fully the model you have created otherwise you may get any
error when exporting.
- set the pivot point of the bounding box - blue axis
points towards the top of the shape, the green axis towards the front of
the shape, and the red axis towards the right of the shape.
|
| 3.
|
Create LOD detail objects
You must have minimally one level of detail object, however
a typical model would have several created for various distances from the
camera.
- create a dummy object and name it detail145, and make it's parent the "Bip01" object
|
| 4.
|
Create the Head
- create a box, name it "head145", position it to sit over the head part of the skeleton
- make the head145 parent the "Bip01 Head" object.
|
| 5.
|
Create the Torso
- create a box
, name it "torso145", position it to sit over the following Biped objects,
"Bip01 Spine", "Bip01 Spine1", "Bip01 L Clavicle", and the "Bip01 R Clavicle"
part of the skeleton
- make the torso145 parent the "Bip01 Spine1" object.
|
| 6.
|
Create the rest of the Upper Body parts
We need to basically repeat step 5 for each of the other parts. (Some of
the part I just clone, move and rename to reflect the opposite side of the
body, ie. l_upperarm -> clone to r_upperarm)
- create a box, name it "l_upperarm145", position it to sit over and make it's parent the "Bip01 L UpperArm".
- create a box, name it "r_upperarm145", position it to sit over and make it's parent the "Bip01 R UpperArm".
- create a box, name it "l_orearm145", position it to sit over and make it's parent the "Bip01 L ForeArm".
- create a box, name it "r_forearm145", position it to sit over and make it's parent the "Bip01 R ForeArm".
- create a box, name it "l_hand145", position it to sit over and make it's parent the "Bip01 L Hand".
- create a box, name it "r_hand145", position it to sit over and make it's parent the "Bip01 R Hand".
|
| 7.
|
Create the rest of the Lower Body parts
- create a box, name it "waist145", position it to sit over and make it's parent the "Bip01 Pelvis".
- create a box, name it "l_thigh145", position it to sit over and make it's parent the "Bip01 L Thigh".
- create a box, name it "r_thigh145", position it to sit over and make it's parent the "Bip01 R Thigh".
- create a box, name it "l_calf145", position it to sit over and make it's parent the "Bip01 L Calf".
- create a box, name it "r_calf145", position it to sit over and make it's parent the "Bip01 R Calf".
- create a box, name it "l_foot145", position it to sit over and make it's parent the "Bip01 L Foot".
- create a box, name it "r_foot145", position it to sit over and make it's parent the "Bip01 R Foot".
|
| 8.
|
Add several additional dummy objects to enable the sequence
Since we intend to use this new model to replace the player.dts
model, we must provide some additional dummy objects which the Torque Game
Engine player code will link the animations with.
- create a dummy object and name it Unlink, and make it's parent the "Bip01" object
- create a dummy object and name it Cam (add to front of face about normal eye height), and make it's parent the "Unlink" object
- create a dummy object and name it Eye (add to front of face about normal eye height), and make it's parent the "Bip01 Head" object
- create a dummy object and name it Mount0, and make it's parent the "Bip01 R Hand" object
- create a dummy object and name it Mount1 (add to the back of torso, like a backpack), and make it's parent the "Torso" object
- create a dummy object and name it Mount2 (clone Mount1, and leave at same spot as Mount1), and make it's parent the "Torso" object
|
|
|
Last but not least!
Try exporting the model as PLAYER.DTS, then copying it into the
tge/example/data/shapes/player/
directory. Run the Torque Game Engine, the new model will be available in
all the missions. It's not pretty, but it should work. There's still a lot
of work to go, adding textures, additional dummy object for additional animations,
etc.. But that's another story!
|
|
Exporting the Shape
NB: Make sure when exporting that the "Command Panels -> Utilities
-> DTS Exporter Utility -> Parameters -> Collapse Transforms" on
the Utilities Tab menu is not checked! Otherwise the Bip01* transforms will
be removed from the .DTS shape, and the sequences won't be able to attach.
The exporter requires a dtsDefault.cfg file for each shape to be
exported, the following is the minimum detail required to export the player_box
correctly. The .cfg needs to be in the same directory as the .MAX model filename: dtsDefault.cfg
AlwaysExport:
eye
cam
mount0
mount1
mount2
NeverExport:
Bip01
Bip01 L Finger*
Bip01 R Finger*
Bip01 L Toe*
Bip01 R Toe*
=Params::T2AutoDetail 250
Adding additional Levels of Detail
This method of doing LOD requires the MULTIRES plugin.
Each shape must minimally have one level of detail dummy object (the
highest level), however a typical model would have several created for various
distances from the camera.
To add additional LOD's to the shape, create a dummy object, name it "detail#"
where # is the LOD, and link it to the "Bip01" object.
- create a dummy object and name it detail80, and make it's parent the "Bip01" object
- create a dummy object and name it detail60, and make it's parent the "Bip01" object
Select all of the body meshes you created in steps 4 - 8, and select the
Edit -> Properties. Add the following two lines of text.
MULTIRES::SIZES = 145,80,60 MULTIRES::DETAILS = 1.0,0.794521,0.630137
...Todo: Explain MultiRes sizes/detail relationship Skinning the Model
...Todo: Still investigating!
|