Chapter 7 | Importing Custom Vehicles


Introduction

In Virtual CRASH, one can easily import third-party vehicle meshes to use as a vehicle model. In Virtual CRASH 6, this process is easiest with .obj mesh files and corresponding .mtl material files. Of course, you can import other formats as well, such as .3ds, .fbx, and .dxf formats.

Preferred Workflow | .OBJ with Associated .MTL File

We began by importing our obj file into our scene. This can be accomplished either by dragging and dropping the file from Windows File explorer or by navigating to Project > Import (remember to set the file type in the lower right corner). This action will open the file import dialogue box. You will need to select the units for the mesh; however, the specific units chosen are not critical. Aim to select units that maintain the raw mesh at a manageable size within the workspace, as this makes it easier to work with.

Below we see the imported vehicle mesh.

If necessary, reorient the mesh so that it points along the global x-axis direction. This process is discussed in greater detail in this post.

Next, we must remove the mesh wheels. There are a few ways to accomplish this task. The easiest method is to leverage our model’s wheel materials. Navigate to the “Materials” menu, switch your cursor control to “Elements” [Shift+E], select the wheel-related materials from the material list, and left-click “select faces.” You should see the wheel-related polygon faces turn red (see below).

For any remaining wheel polygons, left-click (use [F1] mode to safely select without danger of moving faces), then delete.

Next, switch to vertex selection type [Shift+V]. This enables you to visualize the vertices of the mesh. In the left-side control panel, open “Vertices” and left-click “Remove Isolated Vertices”. This action will remove the hidden wheel vertices. This is a critical step, as vehicle specifications are defined relative to vertex positions.

Here we see our mesh without wheel vertices.

Clean up any unwanted vehicle components in the same manner. Once you’re satisfied with the final vehicle geometry, switch back to Object selection type [Shift+O], and select the vehicle. Navigate to Project > Export Selected. Save the model as a .vcm file.

Next, go to the assets browser and import a simulated vehicle model into the scene (it’s unimportant which one). Once the simulated “parent” vehicle object is in the scene, drag and drop your .vcm file from Windows file explorer on top of the parent. When asked “Do you want to replace current mesh?”, press “Yes”.

Don’t be concerned if the vehicle’s proportions appear incorrect. Remember, the parent vehicle’s specifications are being applied to your new mesh. At this step, the primary objective is to ensure the mesh orientation is correct relative to the wheels.

Modify the vehicle’s specifications as needed for your subject vehicle. You will see the mesh actively change size as you modify the length, width, and height values (more information here).

Finally, modify the vehicle’s materials as needed (more information here).

 

Legacy Workflow | No .mtl file

Below, we illustrate the vehicle creation process in the absence of an .mtl file to define materials. Additionally, in the example provided, the vehicle polygons are not neatly separated into elements, presenting a worst-case scenario. This necessitates selecting each individual polygon to assign materials manually. The workflow demonstrated here is carried out in Virtual CRASH 3, where we use an alternative method for assigning materials via the “faces” menu. It is important to note that in Virtual CRASH 6, the preferred approach would likely involve using the Materials menu.

Import Your Model

You can import your new model by going to “Project > Import” and selecting your model (see below), or you can drag your file icon into the Virtual CRASH scene directly from your Windows file manager. 

Position the Model

Set your model’s position to x = 0, y = 0. In this particular case, the orientation has to be set to yaw = 90 degrees in order to ensure the heading is aligned with the Earth frame x-axis (note this particular model was created with heading rotated at yaw = -90 degrees with respect to the Earth frame). 

Remove Wheels

Now we need to remove the wheel polygons in our model because we are going to eventually have simulated wheels for our physics simulation vehicle model. First, select the “Elements” selection type using the upper tool bar.

Select each item associated with the wheels and carefully delete them all (see next three figures below). Do this for each wheel.

After removing the wheel polygons, you may also need to delete the corresponding bottom portion of the wheel vertices. Switch to the Vertices section type, go to profile view, and carefully select the vertices beneath the undercarriage of the car (see figure below). Try to ensure that you only select those vertices associated with the wheel objects. Press delete to remove the selected vertices. Note, if you choose not to do this step, you will likely need to set the ground clearance value to 0 height when the vehicle mesh is finally imported in .vcm format (see end of section). If you choose to delete the vertices, you may need to set the ground clearance value to be appropriate for your subject vehicle.

Set Material Types

Main Body

Select the “Elements” selection type using the upper tool bar. Use the lasso tool to select all of the vehicle components.

With all of the polygons selected, go to the left side control panel, and under the “faces” menu, left-click on “material” to reveal your material options.

Finally, select the “cab” material type. The cab material will enable reflections of the vehicle body, and will inherit the vehicle color from the misc menu.

Create Windows

Select all of the windows in your model. As you select the windows, carefully ensure that the polygons selected with the “Elements” selection type do not include other parts of the vehicle. Remember you can select multiple objects simultaneously by using ctrl+left-click. 

Once the window polygons have been selected, go to the left side control panel, and under the “faces” menu, left-click on “material” to reveal your material options.

Next, left-click on “glass”:

You’ll notice the polygons change in appearance after you change this material type:

As mentioned previously, depending on how the creator of the 3D model grouped the polygons, the “Elements” selection type may pick polygons outside of your intended area. The figure below illustrates an example, where left-clicking on the front windshield not only selected the front windshield polygons, but also the polygons for the roof as well as other undesirable components. In such cases, you will have to select each individual polygon “by hand.”

To do this, first select the “faces” selection type:

Next, using ctrl+left-click, select each polygon within the window:

Now that your window polygons are selected, you can switch to wireframe mode to ensure no other polygons outside of the front windshield were accidentally selected.

Once you are satisfied, again select the “glass” material type:

Note, this same procedure is applicable to any of the other material types you might select, where the elements selection type doesn’t work well due to including unrelated polygons.

Create Lights

Using the “Elements” selection type, left-click on the head lamps and select the “front light” material type:

Select the rear lamps, and then select the “back light” material type:

Create Bumpers

Using the “Elements” selection type, left-click on front and rear bumpers. Select the “bumper” material type:

This will allow you to make the bumpers different colors from the body panels. 

Create Wheel Wells

Using the “Elements” selection type, left-click on wheel wells. Select the “bogie” material type:

Create Interior

Dolly the camera inside of the occupant cabin. Using the “Elements” selection type, carefully left-click on the various interior components. Select the “interior” material type:

Export Your Model

Now you’re finished preparing your model. Go to Project > Export, and save the file in .vcm format.

Import Your Final Mesh

Go to the Virtual CRASH vehicle library and chose an exemplar vehicle. Adjust the wheel positions, geometrical size, and inertial properties of your exemplar vehicle to match your subject vehicle’s properties [1]. Now, drag and drop your .vcm file on top of your exemplar vehicle within the scene.

You’ll be asked if you want to replace the current mesh. Answer yes:

You should now see your custom mesh appear on top of your exemplar vehicle.

You’re now ready to use your custom model! Save your file as a .vc3 file to use the model in the future. Remember, you can open as many .vc3 files simultaneously as you want in Virtual CRASH!


Notes:

[1] For more information on modifying vehicle properties, see User's Guide Chapter 6 | Modifying Vehicle Properties.




Tags: Import custom vehicle, importing vehicles, importing dxf, import dxf, importing 3ds, import 3ds, paint polygons, change polygon color, how to make a window, change material type, change type of material, deleting polygons, removing polygons, remove polygons, delete polygons, removing vertices, deleting vertices, using turbosquid models. 


© 2024 Virtual CRASH, LLC. All Rights Reserved