Virtual CRASH users receive 15% off your purchase of RC Monte Carlo

Blog Post | Importing Large Terrain Meshes

Have mercy on your microprocessor. When importing large dxf or 3ds meshes for use in your simulation environment, be considerate to your system's resources. In this post, we're going to discuss importing large terrain meshes, like the one used for this ad video:


In this simulation, we imported a large mesh file created by Pix4D based on a drone scan of an accident scene. The resulting .ply file was imported into the free software utility MeshLab for inspection:

The first thing that stood out immediately was the large number of polygons in the mesh. MeshLab reported over 1 million faces. Below, we will discuss a few techniques for dealing with such a large number of polygons.

In MeshLab, one can use the "Filters > Remeshing, Simplification & Reconstruction > Quadratic Edge Collapse Decimation" menu command to reduce the number of faces. When working on your own terrain, continue using this command iteratively until you have fewer than 100,000 polygons (if possible), though the necessity to continue with decimating the mesh really depends on the resources of your computer. You can also apply decimation to specific areas which may be of less importance for your simulation, such as trees or buildings in the background. Finally, once you're satisfied with the mesh, export it as a dxf file.

Now, import your mesh into Virtual CRASH 3, either by using the drag and drop method, or by going to "Project > Import." Here is our mesh below:

What we would like to do now is separate those portions of the mesh we know will not interact with the vehicles from those that will. First, select your mesh object, and go to the "faces" selection type. Use the lasso tool to select those polygons you wish to exclude from being used as terrain. Remember, the more faces you can exclude from use by the physics model, the faster your system will perform. Next press the "detach" button in the left side control panel, under the faces menu. This will create a new object for the detached portion of the mesh. Continue detaching other portions of your mesh that you wish to exclude.

Here we've divided the original mesh into four separate objects using the detach command. We've hidden the three portions of the mesh which will not act as terrain in order to highlight to the reader the remaining roadway and shoulder which will be used as terrain. 

Go back to "object" selection type, and select your terrain mesh, then go to "Create > Physics > Make Unyielding / Terrain From Selection." This will tell Virtual CRASH that you want the road and shoulder mesh to interact with the vehicle as a terrain.  

To further improve performance using your terrain mesh, try using the "optimization" option in the left side control panel. Here you can set the number of subdivisions in length and width used in sampling your terrain. This helps speed up performance and can help smooth out any unnecessarily fine details of the mesh object. 

Here we've un-hidden the other non-terrain portions of the mesh, and one sees what appears to be a seamless system of polygons. 

Here is the same scene rendered. 

Again, here is the final animation:

© 2016 vCRASH, Americas, Inc. All Rights Reserved