HOWTO create a car for Ultimate Stunts

This includes the following steps:

Make a 3D model

You can make your 3D model with any 3D modelling program that has export capabilities to usual formats like 3DS. Note that it is currently not possible to preserve things like color and textures during the conversion process to Ultimate Stunts: only positions and normals of the geometry are preserved. The scale is not really important because everything gets scaled in a later stage, but if you want to know it: the basic unit in Ultimate Stunts is meter. It is more important to exactly align your model with the coordinate axes.

Once you are finished, divide your model in three different models: the body, a front wheel and a rear wheel. If front and rear wheels are equal, then you only need one wheel model.

Convert the file format

Export your models to a format that is supported by the 3dto3d utility. 3DS is good. Then use 3dto3d to convert the file to the "smoothed raw" format. For example:
3dto3d /if1 /of1 /dbody.raw body.3ds
Copy the .raw file to a subdirectory of the Ultimate Stunts data tree. Execute these steps for the body, the front wheel and the rear wheel.

Modifications with stunts3dedit

Load the .raw file

Start the stunts3dedit program. It asks for a .gl file in the console window, so give the name of an existing .gl file (a tile or an existing car, this is not important). Then load the .raw file, by pressing shift-F in the openGL window. Answer 'n' to the question if you want to add it as a LOD to the existing scene, then choose to import a .raw file, and give the filename. The given filename must be relative to the ultimatestunts data directory (that's why you had to place the .raw file somewhere in this directory).

Scale the model

If you followed everything so far, then you've succesfully loaded your .raw file. The model's size is probably too big, so scale it around the origin with a size of 5 (key 's'). Alternatively, if you want to apply an exact scale factor, Do a 'rotation' ('r'), and give these answers (example: scale factor 0.5):
Rotate entire scene: y
Rotate around x: n
Rotate around y: n
Rotate around z: n
Give new x axis: 0.5,0,0
Give new y axis: 0,0.5,0
Give new z axis: 0,0,0.5
Now you should be able to see and check your model. If it's OK, then you can temporarily save your model ('f', not 'F'!) to act as a starting point for if something goes wrong in the future.

Set the correct orientation

The correct orientation for the body is: nose towards negative z direction, top towards positive y direction. The correct orientation for the wheel is: axis parallel to x axis, outside towards negative x direction (like a left wheel). If you would sit in a car, then you would have the default openGL orientation: x to the right, y upwards, z backwards. This is also the camera orientation of stunts3dedit at startup, so you might want to restart stunts3dedit to get re-oriented.

After you've read the previous lines for a couple of times, and made some drawings to understand it, you can check if your model has the right orientation. This is probably not the case, as 3D modellers usually have the z axis pointing upwards. Rotate your body ('r') to get it right, and save it.

Translate your model

Ultimate Stunts assumes that the center of gravity of the model is located at the origin. So you need to translate ('t') your model in such a way that the origin lies where you want the CG. Don't confuse this CG with the term CG that is sometimes used in stunts3dedit: here I mean the physical CG in Ultimate Stunts' physics simulation, while stunts3dedit uses a pseudo-CG for some operations, which is the mean of the vertex positions.

Set the right scale

If you are not sure if the current scale is correct, then you can scale your model now. With the autoscale function ('s') you can set the size of the model. For the body you can set e.g. 5 (the length of the car), for a wheel you can set 0.7 (the diameter of the wheel). You must always set the largest size of the model.

Set the colors

You can set color, opacity and reflectance on a per vertex basis ('c'), or on a per primitive basis ('C'). First select the primitive ('p') (and vertex ('v')) , then change ('c' or 'C'). If you have a nice result, don't forget to save.

Primitive order

[TODO]

Collision model

For car body and wheels, the collision model cannot be equal to the graphical model. So for all graphical primitives you need to exclude the "c" from the LODs, and you need to add primitives for the collision model. This is not easy to explain (maybe you can read the stunts3dedit documentation). You can have a look at the existing cars to have an idea of what is expected.

LODs

[TODO]

The car's physics settings

After you've saved your finished .gl files somwhere in the ultimatestunts data directory (a separate directory for your car would be good), you can make the physics settings file. A .conf file from an existing car can act as a starting point: just make a copy of it. You can change it with a text editor. The first thing to change is the location of the .gl files for the body and the wheels: fill in the location of your own files. Now you can already test it with Ultimate Stunts.

The first thing you may want to change is the position of the wheels. Once this position is fixed for your car, you can already drive it. After that you can fine-tune the physical properties of your car. You could enter the values of the real-world car, if you have them. After playing a while with the settings, you'll notice that it's not easy to make a "supercar". For example, a lower mass will increase acceleration, but it will also lower the force on the wheels, which makes them go slipping more easily.