Tutorial: Creating a Vehicle

In this tutorial, you will learn the basics of the Vehicle Systems by modeling a simple eight-wheeled light armored vehicle (LAV).

The Vehicle Systems simplify creating a vehicle by automatically adding constraints and internal logic. Let's look at the basic components of the Vehicle Systems:

Each of these vehicle components and logic modules contain the following sub-sections:

You will start from an existing graphical asset from the Vortex Studio Demo Scenes installation directory. You will import a Graphics Gallery that already contains the 3D model. The default location is C:\CM Labs\Vortex Studio Content <version>\Demo Scenes\Equipment\Vehicle_LAV\Graphic, where <version> is the currently installed version.

Creating the Chassis

In this step, we import an existing Graphics Gallery into the Vortex Studio Editor and prepare the file for work by adding an assembly to receive the various parts and constraints.

Note
In the recommended Vortex workflow, a 3D artist provides the Graphics Gallery and it already contains the required 3D model, along with its meshes, textures and graphics materials.
Task Action References
Create a new mechanism From the Vortex Studio Editor Home screen, click the Mechanism box.
Rename mechanism to LAV Mechanism Select Mechanism in the Explorer panel, then either:
  • Press F2 for editing mode, edit the name to LAV Mechanism and press Enter to confirm.
  • Click Edit at the top of the Properties panel at the right of the screen, change the name in the dialog box, and press OK.
 
Save local copy of Graphics Gallery From the Home page, open the LAV.vxgraphicgallery file located in the Graphic folder mentioned above. Save a copy of the file in your working folding.

 

 
Add Graphics Gallery Switch back to your mechanism's tab.
Select Graphics in the Toolbox.
Double-click Galleries From Files....
In the resulting panel, select LAV and click Ok. (Since you opened the LAV Graphics Gallery in the previous step and have the tab open, it will automatically be detected by the Add Graphics Gallery dialog box.)
 
Examine Graphics Gallery In the Explorer panel, the 3D model is located within a Graphics Gallery than can be expanded via the small triangle on the left. It contains the 3D model and all its associated files (e.g., textures).
Note
You can see the various files but cannot change them. To do so, the Graphics Gallery must be opened in a separate window. Leave this aside for now.
Examine 3D model You should now see the LAV model in the center of the viewport.
You can zoom around the 3D view by scrolling the mouse wheel, and rotate the camera by holding down the middle mouse button and moving the mouse.
Add assembly Select Basics in the Toolbox. Double-click Empty Assembly to add it.  
Add part for chassis Right-click on the LAV > LAV3_Stryker > LAV3_Stryker_Mesh graphics node in the Graphics Gallery and click Create Part... to create a part in the assembly (this will be the chassis for the vehicle). In the resulting window, select Assembly from the Explorer panel.  
Save LAV mechanism You can now save the mechanism file by clicking Save.
In the resulting browser window, find the desired destination folder, and click Save.
Add collision geometry Right-click on the newly created part and select Open Part....
Click the 3D Models tab at the bottom of the Explorer panel. Expand the graphics nodes tree until you find the LAV3_Stryker_Mesh node.
Right-click on the node and select Create  Collision Geometry > Convex Mesh....
In the resulting panel, click Ok to create the collision geometry.
 
Go back to the Explorer panel Go back to the Explorer panel via the Explorer tab.  
Set material Click on ConvexMesh_LAV3_Stryker. In its Properties panel, assign the material Chassis to the collision geometry.  
Set mass Click on the part. In the Properties panel, set the mass to 15000 kg.  
Calculate inertia tensor Calculate the inertia tensor with the Compute inertia and COM button.  
Save part Save and close the part.
Test the mechanism Test the mechanism to see the vehicle chassis drop to the ground.

Creating the Vehicle

In this step, we add a pre-generated vehicle template to the mechanism. The template contains a pre-set list of components and logic modules for a specific vehicle type, in this case a military 8x8 chassis (eight wheels, all powered).

Task Action References
Add vehicle template Select Vehicle Systems from the Toolbox.
Double-click LAV 8x8.
This will automatically add a Dynamics Vehicle extension.
Set wheel positions Each wheel position can be found in the 3D Models view. Note that these are expressed in the world space and that the attachment positions are in the local space of the chassis.
Note
In this case, the default attachment positions for this model are already defined in the LAV 8x8 vehicle template.
 

Connecting the Chassis

In this step, we assign a part to the chassis component of the vehicle.

Note
The Forward and Up Axis of the vehicle in its local frame of reference must always be the X direction.
Task Action References
Locate part field Select the Dynamic Component element of the vehicle extension.
Type "part" in the Search filter at the top of the Properties panel to quickly find the Part field.
 
Assign part to chassis component Select LAV3_Stryker_Mesh from the assembly as the part.  

Setting Dynamics Wheel Parameters

In this step, we set up the dynamics parameters of the wheels, i.e., their basic physical properties.

Task Action References
Set wheel radius Type "radius" in the Search filter to find the radius information for all wheels.
Set the Radius for all eight wheels to 0.55 m.
 
Set wheel width Type "width" in the Search filter to find the width fields for all wheels.
Set the Width for all eight wheels to 0.31 m.
 
Set wheel mass Type "mass" in the Search filter.
Set the Mass of all eight wheels to 30 kg. Be careful not to overwrite the Internal Shaft Mass!
 
Set steering status Type "steerable" in the Search filter.
See that the Front Left Wheel, Front Right Wheel, Front Middle Left Wheel, and Front Middle Right Wheel are set as Steerable.
 

Setting Graphics Wheel Parameters

In this step, we set up the graphic parameters of the wheels, linking the visuals of each wheel to its dynamic behavior.

Note
Once a graphics node is assigned to a dynamic part, it no longer moves with the parent node.
Task Action References
Add connections container Select Basics from the Toolbox.
Double-click on Connection Container.
In the Properties panel, rename the container to "Vehicle Wheel Connections".
Double-click on the new container to open it.
 
Connect wheel graphics to dynamic components In the Explorer panel, click on Vehicle > Dynamic Component and locate the Outputs section.
Type "transform" in the Search filter and drag the Transform array of the Front Left Wheel to the Connection Container.
In the Explorer panel, click on the corresponding wheel's graphics node in the Graphics Gallery.
Find and drag the Parent Transform to the Connections Container.
Connect that wheel's Parent Transform input to the Front Left Wheel's output (see image).
Repeat operation for all eight wheels.

Creating the Collision Rules

In this step, we add collision rules so the various parts of the vehicle do not interfere with each other.

Task Action References
Test mechanism Test the mechanism to see that there is a conflict between the wheels and chassis.  
Add collision rules container Select Basics from the Toolbox.
Double-click Collision Rule Container.
 
Create collision rules In its Properties panel, create a new Collision Detection Rule between the assembly and the Dynamics Component. Select VehicleGroup in the resulting drop-down menu.  
Test mechanism Test the vehicle after this addition to see that it reacts correctly to the environment.
Save mechanism Save the file.

Assigning Materials

In this step, we add a material table to define the contact properties of the various materials assigned to the parts, and change the properties of the grid so that we can use it for testing.

Task Action References
Check the current material table Open the material table by clicking and selecting Material Table.
(If the default material table is not loaded, use the folder icon to open default.vxmaterials from the Demo Scenes file directory.)
 
Assign material to wheels Select Vehicle > Dynamics Component and type "material" in the Search filter.
Notice that all wheels have been assigned the Wheel material by default.
The Material in Contact output properties indicate which material the wheels are interacting with at runtime.
 
Assign a material to the grid Right-click in the 3D View and select Grid....
Select Ground as the grid material from the drop-down menu.
Click OK to save and exit the Grid properties.
 
Test the mechanism Test the mechanism and check the Properties panel to see how the Material in Contact changes.

Controlling the Vehicle

In this step, we turn on the engine to make our vehicle move.

Task Action References
Turn on engine In the Explorer panel, select Vehicle > Dynamics Component.
Type "engine" in the Search filter of the Properties panel and select the EngineEngine Running box.
Type "input throttle" in the Search filter and set Throttle Logic > Input Throttle to 0.5.
Type "lever position" in the Search filter and set the value of the Lever Position to D1.
 
Test mechanism Test the mechanism to see it move forward.

Assigning Torque Tables

In this step, we assign an external CSV file from which data will be pulled to set the proper RPM > Torque engine operation curve.

Note
The CSV files need to be formatted such that the first two columns include the data points to be mapped, e.g., RPM data converted to Thrust data.
Task Action References
Assign torque table In the Explorer panel, select Vehicle > Dynamic Component.
Type "CSV" in the Properties panel's Search filter and set the Torque Table CSV file (LAV_TT.csv, found at C:\CM Labs\Vortex Studio Content <version>\Demo Scenes\Equipment\Resources\VehicleSystems).
 

Adding a Camera Extension

In this step, we add a camera to get the viewpoint of someone aboard the vehicle.

Task Action References
Add camera extension Select Cameras in the Toolbox.
Double-click Perspective.
 
Attach camera to LAV Open the Connections Container.
Create a new connection between the Parent Transform of the camera's inputs and the World Transform of the LAV3_Stryker part's outputs.
Position camera Use the Move and Rotate tools to position the camera where the operator would sit. In this case, move the camera to be at the top of the turret.  
Split Viewport Right-click in the 3D View and select Viewport Configuration.... Split the main viewport into two sections.  
Switch to camera view Use the 'C' key to set the viewpoint to the camera in one of the viewports.  

Add a Joystick Extension

In this step, we add a joystick that we will use later to control the LAV.

Task Action References
Add joystick extension Select Input Devices in the Toolbox.
Double-click Joystick.
 
Test joystick extension Select the joystick extension in the Explorer panel and interact with the joystick hardware to see generated position data in the Properties panel.  
Connect joystick outputs From the Explorer panel, open the Connections Container.
In the Explorer panel, select the Joystick extension.
In the Properties panel, select AxisX and drag it to the Connections Container.

Connect vehicle component input In the Explorer panel, select Vehicle > Dynamic Component.
In the Properties panel, select Inputs > Ackerman Steering > Input Steering and drag it to the Connection Container.
Connect the Input Steering input to the AxisX output.
Add new connection Create a second connection for the throttle between the joystick's AxisZRot and Dynamic Component > Inputs > Throttle Logic > Input Throttle.
Test mechanism Test the mechanism. You should be able to steer and accelerate via the joystick.

Creating a Test Scene

In this step, we create a basic scene to test our vehicle.

Task Action References
Open scene Open an existing scene from the Demo Scenes file directory (../Scenario/Defense Vehicles Scene/Defense vehicles.vxscene).
Save a copy in your working folder.
Delete all mechanisms in the Mechanisms folder, except for Cultural Objects.
 
Add vehicle Add the complete LAV vehicle to the scene from the Menu bar by selecting Basics from the Toolbox, then double-clicking Mechanisms From Files... and choosing ../Equipment/Vehicle_LAV/Dynamic/Design/LAV.vxmechanism. If you have trouble locating the LAV vehicle, right-click it in the Explorer panel and select Center in Active View.
Using the Move and Rotate tools, position the LAV outside of the test course.
 
Test mechanism Test the scene and drive the LAV around.
Experiment with the different terrain materials in the scene.

Adding Armor to the LAV

In this step we load additional armor on the LAV to see how it affects the handling. The armor belt is a separate mechanism that is attached to the LAV via attachment points.

Task Action References
Add armor mechanism Insert LAV_HPK.vxmechanism from the Demo Scenes folder into the scene that already contains LAV Mechanism.  
Locate the attachment points In the Explorer panel, using the small triangles, expand both mechanisms to expose the attachment points in each (i.e., LAV > Assemblies > Chassis Assembly).  
Attach armor Using Ctrl + left mouse button, select both the HPK Attachment point under the LAV Mechanism and the HPK Attachment point under the LAV_HPK.
Right-click on one of the points and select Create Attachment.
 
Align armor Select the newly created attachment and in its Properties panel, select the Snap box to align the armor to the vehicle body.  
Test mechanism Test the scene and drive the LAV around.
Experiment with the different terrain materials in the scene.

Tuning the Engine

In this step, we start tuning the vehicle (go back to the mechanism you created earlier). This is done by modifying values in the parameters corresponding to the Vehicle Components and Vehicle Logic Modules.

Task Action References
Tuning the engine system Select LAV Mechanism > Dynamics Component in the Explorer panel.
Using the filter, search for the following parameters and alter them as desired:
  • Internal Shaft Mass
  • Internal Shaft Inertia
 
Adjust Torque Table Locate the Torque Table on the computer (i.e., LAV_TT.csv, found in within your Demo Scenes folder at \Equipment\Resources\VehicleSystems).
Using a spreadsheet program, alter some values and save the file under a different name.
In the Explorer panel, select Vehicle > Dynamic Components.
Type "CSV" in the Properties panel's Search filter and set the Torque Table CSV file to the edited file.
 
Test mechanism In the Property panel's Outputs, check the values to see the results of importing or modifying a torque table file.  

Tuning the Transmission and Differentials

In this step, we tune the transmission and differentials (when the latter are present).

Task Action References
Tuning the transmission Select Vehicle > Dynamic Components. The number of gear ratios is located in the Properties panel under Parameters > Automatic Transmission > Gear Ratios.
The Gear Ratios > Size field sets the total number of gears available (including neutral and reverse).
Set a ratio for each gear. The lower the ratio (in absolute value), the lower the torque transferred and the higher the speed.
  • Negative ratio for reverse gear
  • 0 for neutral gear
  • Positive ratio for forward gear
In Parameters > Automatic Transmission, set the following parameters (if not already done by default):
  • Shift Again Delay: 0.5
  • Shift Delay: 0.4
  • Gear Change Down: 0.45
  • Gear Change Up: 0.7
  • Gear Quick Change Down: 0.7
  • Gear Quick Change Up: 0.95
  • Gear Change Table: Not used (this allows the insertion of a table to set rules specific to each gear, such as special percentages per gear)
 
Tuning the differentials Select which differentials can be locked, and whether they are locked.
In Parameters > Differential, for each differential, select Has Lock.
In Inputs > Differential, for each differential, make sure Enable Lock is not selected (differential is not locked, but can be at runtime since this is an input).
Power distribution is determined through each differential by Gear Ratio parameters.
 

Tuning Wheel and Ackerman Steering

In this step, we fine-tune the wheels and Ackerman steering behavior.

Task Action References
Tuning the braking and engine torques In the Explorer panel, select Vehicle > Dynamic Component.
In Inputs > Engine, set the following parameters if not already done (this sets the amount of torque transmitted, 0 being none and 1 being maximum torque):
  • Braking Torque Scale: 1
  • Engine Torque Scale: 1
 
Tuning wheel components In Inputs, for each wheel component, set the following parameters if not already done:
  • Brake Scale: 1 (this sets the amount of braking torque for that wheel, 0 being none and 1 being full brake)
  • Suspension Damping: 20000 kg/s
  • Suspension Stiffness: 160000 N/m
 
Tuning the Ackerman steering logic In Parameters, set the following for the Ackerman Steering, if not already done:
  • Ackerman: 1 (use 0 for parallel steered wheels, 1 for full Ackerman motion)
  • Reference Position: -1.179 m
  • Steering Max Speed: 360
  • Check Use Default Reference Position (This calculates the center of rotation from non-steered wheels. Checking this variable overwrites the "Reference Position" data.)
  • Steering Max Angle: 25