If you have a 3D model of a physical object, you can import that digital model into the Model Target Generator (MTG) desktop tool and generate a Model Target for tracking the physical object. The MTG supports a variety of file formats and model types and provides various options to configure your target for optimal detection and tracking performance. This article provides a step-by-step introduction to the MTG and the generation of a Model Target.
Installing the MTG
Refer to the Model Target Generator User Guide for installation instructions.
Launching the MTG
- Open the Model Target Generator from the location where you installed it or via the shortcut.
- A login dialog opens where you must enter your Vuforia Developer account credentials. See How To Register as a Vuforia Developer if you do not yet have an account.
Creating a Model Target
The MTG package includes the NASA Viking Lander as a 3D model.
- Click the Create New Model Target button (or select Open Model Target to open a previously created project).
- Click the Select... button.
Ensure the Location field is not set to an unmapped network path.
- Open VuforiaMars_ModelTarget.pvz, located at:
By default, the Model Target Name is filled with the same name as the CAD model file. It can be changed if you so wish.
- Click the Create Model Target button.
The model displays in the 3D viewer alongside an introductory message.
- You may choose to press Continue or Never Show Again to close the message.
The top bar presents a number of tabs where each represents a step in configuring your model for generating a suitable Model Target. Once a step is complete, the tab will be highlighted in green and the meter in the upper right corner may increase its progress. When the progress meter turns green, the MTG has determined that the Model is fully configured and ready to be generated as a Model Target. Evidently, it does not matter which order you go through the tabs. Expert users may skip some tabs and generate a Model Target even when the progress meter is ‘low’.
NOTE: Re-importing a model will require you to repeat some steps, such as Coloring.
In the 3D view pane, use the Rotate, Zoom, and Pan icons to navigate around the model to inspect it for missing parts or incorrect normals. Refer to the Model Targets Supported Objects & CAD Model Best Practices article for more information.
The tab which your model is loaded in, is used to adjust orientation of the imported model.
- Select and Confirm the preview that aligns the plane with your model.
The size of the Model Target needs to match the size of the object in the physical world. Since the model units are usually not encoded in a CAD model, it is necessary to select the correct units (e.g. meters, feet, centimeters, etc.). In the 3D view window, the current interpreted size is displayed.
- Select the File Units to match the size of the physical object.
NOTE: The unit selected does not re-scale the 3D model. Instead, the unit specifies how a unit of one is interpreted. Rescaling the model is not supported in the MTG because it is designed to be a 3D model viewer, and not a mesh editor. You may need to change the size of the CAD model using its creation tool. Alternatively, try a different model file format. Some file formats, such as obj, are unit agnostic. Also, be attentive to the model scale when importing the Model Target database into Unity. This vigilance ensures that the sizing is consistent throughout the development process. More information on scaling Model Targets can be found in the Best Practices for Scaling Model Targets.
Imported models that consist of multiple parts and do not include texture or multiple colors will be recommended to receive automatic coloring by the MTG. Coloring the different parts of a model can help to improve tracking performance. Models that consist of a single mesh would only receive a single color and therefore no improved tracking. Models with textures do not need coloring and this tab can be skipped.
- In the depicted case, the model that came with the MTG consists of multiple parts and no texture. Click the Apply Coloring button to automatically color the model. Coloring can always be undone. For a complete guide on coloring, please see Automatic Coloring of Model Targets.
This tab measures the complexity of your model which should be under a certain number of vertices and parts; see CAD Model Best Practices for recommended model specifications and steps to reduce complexity. The Model Target Generator offers a possibility to simplify the model directly before generating the Model Target. This will require uploading the model to the Vuforia servers. See MTG Data Processing for more information.
Exceeding the model recommendations will result in a warning that the complex model may harm app performance. If the model is within the performance requirements, this tab can be skipped.
NOTE: Coloring should be applied before simplification. Coloring the model after simplification will require to repeat the simplification process. See Automatic Coloring of Model Targets for more information.
In this example, the model was identified as too complex with 102 parts and 1.311.459 polygons.
- To upload your model for processing, press Start Simplification. Once the model is uploaded, the MTG progresses to the next tab – Model Type. Since simplification is done asynchronously, it is possible continue with the configuration of the Model Target in the other tabs, with exception of coloring.
- At any point, you can return to the Complexity tab and see the progress of simplification or Cancel the process.
When simplification is completed, you can inspect the model. The simplification algorithm is optimized for Model Target detection and tracking, preserving edges and contours of the model. Please ensure that the simplified models do not have any gaps or cracks that were not present in the original model. In the panel to the right, you can see the simplified model’s number of parts and polygons.
- It is possible to Undo the Simplification from the Complexity tab. This will delete the simplified model.
The Model Type tab is used to select a tracking mode for your model. Assigning a tracking mode depends on the physical object:
- DEFAULT works well on a variety of model objects
- CAR can be used for cars and other reflective and large objects
- 3D SCAN is specifically for objects that are intended to be tracked from textured 3D scanned digital models.
For a complete guide, please see Optimizing Model Target Tracking.
- Select the tracking mode best suited for your model type. In this example, we select DEFAULT that has proven to work well with 3D printed and matte objects and proceed to the next tab by clicking Confirm.
This setting is used to specify what scenario the Model Target is used in:
- If the object is likely to be moved, ADAPTIVE should be selected.
- STATIC should be selected if the object is stationary
- DYNAMIC should be used for objects in constant motion.
For a more extensive explanation of the different motion hints, see Optimizing Model Target Tracking.
The hint is then stored in the generated dataset and can be overridden later in native or Unity in the generated .xml file.
- Select either STATIC or ADAPTIVE and press Confirm.
Guide Views are essential when it comes to initiate tracking of a Model Target. You can choose between Guide Views and Advanced Views. Mixed Guide View types is not supported.
Guide Views are presented as a rendered outline of your model that, during the AR session, users will match with the object to initiate the AR experience.
Advanced Views are recognition ranges that automatically activate the AR experience when the model is detected from any defined angle. Selecting the Advanced view will require the model to be trained in the cloud. If you wish to create Advanced Views please refer to Advanced Model Target Databases.
We select in our example Create Guide View.
- Before moving on with the Guide View, a field of view should be defined according to how the users would handle the device. Choose between the Digital Eyewear, Landscape, or Portrait.This setting can also be selected from the three icons in the right corner of the 3D view pane. Depending on your selection, the dotted line in the 3D view pane adjusts the screen rendering area of the app.
- Click Next Step.
- Now, we need to adjust the view with the tools in the upper left corner of the 3D view pane. The view and dotted frame should be adjusted to a position we would like the users to match with to start the tracking of the Model Target. Once adjusted, the centered Create Guide View button will create a Guide View from that exact position and distance.
TIP: Your mouse can also be used to change the position.
The right column provides with guides on the best practice of creating a Guide View.
- In the following step, on top of the Guide View preview, you will find three icons;
- to edit recognition ranges. The Recognition Range pane is particularly for Advanced Views. Use it to transform your Guide View to an Advanced View. Refer to the Model Target Guide View for more information on adjusting these values.
- to reposition the Guide View.
- to delete the Guide View.
- Rename the Guide View (e.g., front, back, above, below, close-up, advanced 90 degree view).
- Our Model is now ready, and the Progress Meter confirms that we have attended to all the tabs and configurations available to us. Click the Generate Model Target. This will take us back to the Home Screen.
Generating Model Targets
When the Generate Model Target button is clicked, a dialog opens that displays the number of remainingtargets on your developer account as well as the Guide Views and directory where the Model Target database will be saved. The Guide Views are saved as PNGs and the Model Target as .vup project file.
NOTE: These images can be replaced with custom Guide View images to present to the user instead of the Vuforia Engine provided default image.
Every Model Target generated counts against your target quota. Re-generation of the same model with a different Guide View also counts as new. Additionally, every training session counts against the training quota, which is separate. For specific quota options associated with any license, refer to the pricing page.
Managing Model Targets
- In the Home Screen, click the menu (...) icon and select Open Destination Folder.
The destination of the generated Model Target database opens in the project folder.
You can now load the Model Target database into your Unity or Native project environment or download the Model Target Test App to test the tracking capabilities of your Model Target.
If you wish to create Advanced Model Targets, refer to the Advanced Model Target Databases article.