Vehicles and wheels
by Katrina Rose · in Torque Game Engine · 09/24/2004 (9:09 am) · 6 replies
Hi,
When we add our vehicle model we are getting the following errors:
The official documentation for Torque are really outdated and don't contain any usefull information about adding vehicles into torque. When we use the buggy.dts file from the demo it works fine. We are using 4 hubs (hub0,hub1,hub2,hub3) and in the dump file they seem to be exported, but they are not comming in torque for some reason. I first thought it could be the exporter or the config file because if we export the buggy.max file with our max exporter we get the same error, but we are not sure what's going on. Any help would be apreciated.
Marrion Cox
When we add our vehicle model we are getting the following errors:
setWheelTire: wheel index out of bounds, vehicle has 12862087 hubs setWheelTire: wheel index out of bounds, vehicle has 12862087 hubs setWheelTire: wheel index out of bounds, vehicle has 12862087 hubs setWheelTire: wheel index out of bounds, vehicle has 12862087 hubs setWheelSteering: wheel index out of bounds, vehicle has 12862087 hubs setWheelSteering: wheel index out of bounds, vehicle has 12862087 hubs setWheelPowered: wheel index out of bounds, vehicle has 12862087 hubs setWheelPowered: wheel index out of bounds, vehicle has 12862087 hubs
The official documentation for Torque are really outdated and don't contain any usefull information about adding vehicles into torque. When we use the buggy.dts file from the demo it works fine. We are using 4 hubs (hub0,hub1,hub2,hub3) and in the dump file they seem to be exported, but they are not comming in torque for some reason. I first thought it could be the exporter or the config file because if we export the buggy.max file with our max exporter we get the same error, but we are not sure what's going on. Any help would be apreciated.
Marrion Cox
About the author
#2
1. Create the mesh/meshes that make up the vehicle body and wheels using whatever favoured method you prefer. Make sure that none of the mesh's names end in numbers. Helps if it is centered on origin.
2. Also create the collision mesh for the vehicle, which should be a rough envelope with as few polygons as possible. It need not cover the wheels as they will be seperate objects.
3. Select the body of the vehicle (for us it was just one mesh). From the utilities tab dropdown, find the DTS exporter. Click renumber selection. It will prompt you for a number. (we used 1) Click on "embed object". This will create the hierarchy.
4. Create one box titled 'bounds' make sure it covers the whole body of the car.
5. Make sure that the "Collapse Transforms" option is off on the DTS exporter menu. Click on "Export whole shape".
6. Dump the dts in default project, and use "torquedemo -show" to preview it and make sure everything is okay.
7. Link the collision mesh created in step 2 to "Start1". "Start1" should also be the parent of the vehicle body mesh. Rename the collision mesh "Col-1".
8. Create a dummy object and call it "Collision-1". Make this a child of the root dummy object (I think it is called "Shape"). The root dummy object is the parent of the "Start1" dummy object.
9. Create a dummy object and call it "mass". Put it roughly in the center of the vehicle. Lower for easy driving. Make this a child of "Start1".
10. Create a dummy object and call it "eye". Put it where the camera for the in-cabin driving mode (1st person) is supposed to be. Make this a child of "Start1".
11. Create a dummy object and call it "cam". Put it where the trailing cam (3rd person) is supposed to be. Make this a child of "Start1".
12. Create a 4 dummy objects and name them "hub0", "hub1", "hub2", "hub3". Place them at the center of your wheels. For best effect, "hub0" and "hub1" should be the front wheels. The wheels should be as high as the suspension would normally allow them.
Make these children of "Start1".
13. Make sure that the "Collapse Transforms" option is off on the DTS exporter menu. Click on "Export whole shape". The car body is done.
14. Select one of the wheels. Save it into a seperate max file. Open this file and rename the mesh so that it does not end in a number.
15. Select the lone wheel, click renumber selection. It will prompt you for a number. (we used 1) Click on "embed object". This will create the hierarchy.
16. Create a box and call it "bounds" make sure the box surrounds the whole wheel.
17. Create a box and call it "col-1". Make this a child of "Start1".
18. Create a dummy object and call it "Collision-1". Make this a child of the root dummy object (I think it is called "Shape"). The root dummy object is the parent of the "Start1" dummy object.
19. Make sure that the "Collapse Transforms" option is off on the DTS exporter menu. Click on "Export whole shape". The car wheel is done.
20. Put these two DTS files in the datablocks and (this is very important) pray. Fire up torquedemo and if you're very lucky, there's your no-frills car!
Chances are you will need to adjust the values in the vehicle spring datablocks to prevent the car from jumping (if values are too high) or rear wheels from sinking when stationary (if values are too low).
There's also a high likelyhood that you will need to rotate the car body and/or wheels and re-export them (several times) because they are facing the wrong direction. (haven't quite figured out the dynamics yet.) Don't rotate the whole thing, just the pivot points (or whatever my trusty sidekick meant by that).
Hope this helps you and you can spot whatever you might have missed. If not, take comfort that it has at least helped me revise what I learnt today! ;-)
P.S. By the way, hello GG people. Nice place!
09/27/2004 (6:28 am)
Not sure if this will help, but my trusty artist sidekick and I took on the exporter today. The somewhat refined procedure we have now is:1. Create the mesh/meshes that make up the vehicle body and wheels using whatever favoured method you prefer. Make sure that none of the mesh's names end in numbers. Helps if it is centered on origin.
2. Also create the collision mesh for the vehicle, which should be a rough envelope with as few polygons as possible. It need not cover the wheels as they will be seperate objects.
3. Select the body of the vehicle (for us it was just one mesh). From the utilities tab dropdown, find the DTS exporter. Click renumber selection. It will prompt you for a number. (we used 1) Click on "embed object". This will create the hierarchy.
4. Create one box titled 'bounds' make sure it covers the whole body of the car.
5. Make sure that the "Collapse Transforms" option is off on the DTS exporter menu. Click on "Export whole shape".
6. Dump the dts in default project, and use "torquedemo -show" to preview it and make sure everything is okay.
7. Link the collision mesh created in step 2 to "Start1". "Start1" should also be the parent of the vehicle body mesh. Rename the collision mesh "Col-1".
8. Create a dummy object and call it "Collision-1". Make this a child of the root dummy object (I think it is called "Shape"). The root dummy object is the parent of the "Start1" dummy object.
9. Create a dummy object and call it "mass". Put it roughly in the center of the vehicle. Lower for easy driving. Make this a child of "Start1".
10. Create a dummy object and call it "eye". Put it where the camera for the in-cabin driving mode (1st person) is supposed to be. Make this a child of "Start1".
11. Create a dummy object and call it "cam". Put it where the trailing cam (3rd person) is supposed to be. Make this a child of "Start1".
12. Create a 4 dummy objects and name them "hub0", "hub1", "hub2", "hub3". Place them at the center of your wheels. For best effect, "hub0" and "hub1" should be the front wheels. The wheels should be as high as the suspension would normally allow them.
Make these children of "Start1".
13. Make sure that the "Collapse Transforms" option is off on the DTS exporter menu. Click on "Export whole shape". The car body is done.
14. Select one of the wheels. Save it into a seperate max file. Open this file and rename the mesh so that it does not end in a number.
15. Select the lone wheel, click renumber selection. It will prompt you for a number. (we used 1) Click on "embed object". This will create the hierarchy.
16. Create a box and call it "bounds" make sure the box surrounds the whole wheel.
17. Create a box and call it "col-1". Make this a child of "Start1".
18. Create a dummy object and call it "Collision-1". Make this a child of the root dummy object (I think it is called "Shape"). The root dummy object is the parent of the "Start1" dummy object.
19. Make sure that the "Collapse Transforms" option is off on the DTS exporter menu. Click on "Export whole shape". The car wheel is done.
20. Put these two DTS files in the datablocks and (this is very important) pray. Fire up torquedemo and if you're very lucky, there's your no-frills car!
Chances are you will need to adjust the values in the vehicle spring datablocks to prevent the car from jumping (if values are too high) or rear wheels from sinking when stationary (if values are too low).
There's also a high likelyhood that you will need to rotate the car body and/or wheels and re-export them (several times) because they are facing the wrong direction. (haven't quite figured out the dynamics yet.) Don't rotate the whole thing, just the pivot points (or whatever my trusty sidekick meant by that).
Hope this helps you and you can spot whatever you might have missed. If not, take comfort that it has at least helped me revise what I learnt today! ;-)
P.S. By the way, hello GG people. Nice place!
#3
About the eye and cam. You had eye correct in saying that you want it to be where you would have your real eyes if driving, but the cam is more dynamic. You can place the cam exactly where you place the eye(clone and rename) and use the datablock offset to put it above and behind the player or vehicle where you need it.
cameraOffset = 2.5;
Other than that all of this info can be found in the exporter documentation so this hasn't been any more help than they would be. Have you not reviewed the docs?
09/27/2004 (7:56 am)
Axis Y is forward. I have noticed a lot of modellers point their objects in just any random direction when they build. That's fine for making art, but TGE expects you to consider Y as your forward vector. A common mistake is to build an object(say a humanoid) facing the correct direction(towards Y) and get distracted while creating the bounds box, and actually face the bounds box backwards. When they export they find their model facing 180 degree's the wrong way even though they know they faced it correctly. About the eye and cam. You had eye correct in saying that you want it to be where you would have your real eyes if driving, but the cam is more dynamic. You can place the cam exactly where you place the eye(clone and rename) and use the datablock offset to put it above and behind the player or vehicle where you need it.
cameraOffset = 2.5;
Other than that all of this info can be found in the exporter documentation so this hasn't been any more help than they would be. Have you not reviewed the docs?
#4
Actually the official exporter documentation isn't all that helpful. It made no mention of the hub nodes, and includes a bunch of extra things like animation sequences, ground nodes for each wheel, LOS collision nodes, etc., all of which I haven't had to use to get the basic wheeled vehicle up and running.
The info can be gleaned from a mixture of tutorials and bits of the documentation. Sorting out the must-haves, nice-to-haves and has-beens can be a bit of a bother. It would be no surprise if something that veteran TGE users take for granted was missed out.
09/27/2004 (8:26 am)
Ahh, Y is forward. Good thing to know. Same for the cameraOffset.Actually the official exporter documentation isn't all that helpful. It made no mention of the hub nodes, and includes a bunch of extra things like animation sequences, ground nodes for each wheel, LOS collision nodes, etc., all of which I haven't had to use to get the basic wheeled vehicle up and running.
The info can be gleaned from a mixture of tutorials and bits of the documentation. Sorting out the must-haves, nice-to-haves and has-beens can be a bit of a bother. It would be no surprise if something that veteran TGE users take for granted was missed out.
#5
And you are right, the official documentation is outdated!
09/27/2004 (8:50 am)
I get this error if I forget to un-check "collapse transforms".... so I'm guessing that's the problem.And you are right, the official documentation is outdated!
#6
11/08/2004 (9:04 pm)
Veriffied and checked : "collapse transforms" IS the problem. Otherwise the model behaves very well on export providing that you respect the other issues.
Torque 3D Owner Martin "Founder" Hoover