DTS/Milkshape/Creating a Simple Wheeled Vehicle
From TDN
[edit] OverviewThis article assumes a basic working knowledge of Milkshape (MS3D), modelling within MS3D is not covered as it is beyond the scope of this tutorial. This tutorial assumes that you have the DTS plus exporter installed, if you don't then grab it here. The BuggyGT.ms3d file referred to in the article as well as the required art is currently offline. [edit] Importing Vehicle/Assigning MaterialsImport the BuggyGT.obj Object file by going to File-->Import-->Wavefront OBJ The group of objects within the BuggyGT.obj file will appear in the viewport as a black box, right click in the viewport and select 'Textured'. Still there will be no change so click on the 'Groups' tab then select the 'col-1- <No Material>' object, in the Group section below click hide then change the name to 'collision-1' and press 'Rename'. While your at it rename the rest of the objects removing the '-' from the end of each one. Select the body100, body60, body30 and body2 objects pressing 'Select' after each one then head over to the 'Materials' tab. Select 'New', change the new materials name from 'Material01' to 'body' and click 'Rename'. Then press <none> and choose body.jpg from the BuggyGT folder and then click 'Assign' then finally click 'Emissive' and move the slider from black to white and you should be seeing the body of the vehicle textured. Repeat this process for the other vehicle parts naming the materials lights, glass, chrome and axle respectively. Assign the axle material to all the axle objects. [edit] Suspension SetupStart by creating a joint, click the 'Model' tab and select 'Joint'. Now when you click within a viewport a joint will be placed in this position, I find using the side elevation viewport the best to use as the joints are automatically centred. Rename this joint by going to the 'Joints' tab and typing 'cam' in the field and pressing 'Rename'. Now create a joint called 'eye', this will be where the first person camera will be placed. Ensure that you deselect the first joint before placing the second as you don't want to make it a child of the first. Now create a seperate object in the centre of the car (actually it can be anywhere but its easier to follow with this method), call this joint 'suspension' as its the beginning of what will be your suspension setup. Create another joint, this one a child of the suspension joint at the front of the vehicle and call it 'front_diff', from this joint will be 4 separate joints; hub0, hub1, axle0, axle1. Place the hub0 joint at the point the wheel will be in its fully compressed position, btw this is the front left wheel (or port bow). Place the axle0 object at the pivot point for the axlezero objects. Do the same for the front right wheel (starboard bow), naming the first joint hub1 and the second joint axle1. Now repeat the process for the rear/stern of the vehicle, but naming the joints rear_diff, hub2 and axle2 for the right/starboard, hub3 and axle3 for the left/port side. [edit] Suspension Wheel Animation SetupEnsure nothing is selected, select the hub0 joint under the 'Joints' tab then click the 'Model' tab and select 'Move' from the available tools. What you'll need to do it set the same 'up' position for at least 9 frames in the animation bar, this is to ensure that hub0 doesn't move while other wheel animations are going on. Click the 'Anim' button down the bottom, and move the hub0 joint up by 1.0 (Y axis)then moving it back down -1.0 and then selecting Animate-->Set Keyframe or by pressing Ctrl K. Do this for the 8 other frames also. Now that the up keyframes have been set, move the slider to frame 2.0 and move the hub0 to its fully extended position and set keyframe (Ctrl K), then your done for this hub. Repeat this process for hubs 1 through 3 but record the down key frame on different frames; hub1 on frame 4, hub2 on frame 6, and hub3 on frame 8. Remembering to set the up keyframes for all first, this is a crucial part of the process. [edit] Suspension Object Animation SetupEnsure nothing is selected, press the 'Joints' tab and select the axle0 joint from the list then press the 'Groups' tab and select axlezero100, axlezero60 and axlezero2. Go back to the 'Joints' tab and press assign. As with the hub joints go through and set all the 'up' keyframes the same by going to the 'Model' tab and rotating the joint up and down (Z axis) by 30 and -30 respectively. Now go to frame 2.0 and rotate the axle0 joint so the axlezero objects match the animation of the hub0 joint. Repeat this process for the other axles remembering to use the following frames; for axle1 frame 4, for axle2 frame 6, for axle3 frame 8. [edit] Exporting VehicleSelect File-->Export-->Torque DTS Plus Under 'Sequences' Select Add, change the name to spring0 and ensure the First Frame is 1 and the Last Frame is 2 then press OK, do this for spring1, spring2 and spring3 ensuring the appropriate frames are assigned. Then Press ExportDTS and you're done, add the buggyGT.dts and all the appropriate art to YOURPROJECT/data/shapes/BuggyGT folder. Open up your server/scripts/car.cs file and change the path to point at the BuggyGT.dts. While you're there you might like to give the BuggyGT some more horses under the bonnet (engineTorque) and play with the friction levels to make it steer a little better. |
Categories: Art | DTS | Tutorial






