Model Target Generator User Guide

The Model Target Generator (MTG) converts an existing 3D model into a Vuforia Engine dataset that can be used by the Vuforia Engine for Model Target tracking. This tool enables you to confirm whether the features of your model will be useable, to set-up the initial snapping position, and then export the final dataset.

The dataset produced by the MTG includes several renderings of the model (“guide view”) from the initial snapping point so that Vuforia Engine App developers can modify and replace the default guide view image that the Vuforia Engine API provides.

Description

MTG can be used to read a variety of 3D file formats and converts them into Vuforia Engine’s internal mesh format upon loading. Consequently, any visual error in the model introduced in this conversion process will be displayed in the MTG viewport. Some source model formats can result in wrongly converted models since they are missing mesh information. Therefore, it is necessary that the MTG is used to check whether the imported model corresponds to the source data. For the case that there are issues, the source data needs to be cleared (or in some cases using a different transport format can fix issues).

Functionality

After importing the 3D model into the MTG, the user should make sure the model fulfills the requirements of the checklist displayed on the side. In addition, the user needs to make sure that the scale of the model is correct. Some file formats do not have unit information propagated through the import pipeline. For this reason, the MTG displays the size of the volume occupying the object in meters. In case the object is in fact modelled in a different unit, it can be changed in the pop-up menu. This information is then propagated to the exported dataset to ensure tracking works properly. Setting the unit in the UI does not re-scale the 3D object - it only specifies how a unit of 1 is supposed to be interpreted. Rescaling the model is not supported in the MTG as it is only designed to be a 3D model viewer, rather than an editor.

Using the Model Target Generator Tool

Minimum System Requirements

  • 64-bit, Windows 7 or later

Models

Requirements:

Vuforia Engine’s Model Target Tracking performs best on models that are below the 10 part and 400k polygon threshold. While it is able to use models of higher complexity, tracking performance might degrade as the complexity of the model increases. Ideally the models are in a color similar to the objects being tracked. However, it is possible to use an all-black model to track a colored object. In general, the model should be as close to the real object as possible in order to get the best detection tracking performance.

Supported features

The import pipeline supports meshes containing:

  • Multiple sub-meshes
  • Vertex positions
  • Vertex normal
  • Vertex texture coordinates (one set only)
  • Diffuse solid colors
  • Diffuse texture colors

In case the input model provides more than the aforementioned information (e.g. normal maps, additional texture coordinate sets), they will be ignored upon import.

Supported formats

The MTG supports reading of: Creo View (.pvz), Collada (.dae), FBX (.fbx), IGES (.igs, .iges), Wavefront (.obj), STEP (.stp, .step), STL (.stl, .sla), VRML (.wrl, .vrml). When installed for Creo View, JT is also supported.

The best import results have been observed with Creo View, Collada, FBX and JT.

Model Preparation

When preparing the 3D model for the MTG, the user needs to check that the scale of the digital and the physical object matches. Attempting to track a toy replica with the 3D model of the full-size object can fail in some instances. In order to be sure to get the best tracking quality, the sizes of the models need to match.

If the model has more than 400,000 polygons or more than 10 parts, the model will need to be simplified. The process of simplification consists of reducing the number of polygons needed to represent the object as a mesh. Simplification is required for the computer vision algorithms to run on mobile devices in real-time and polygon reduction does not have impact on the detection and tracking accuracy, as long as it is not too coarse.  

Any simplification tool will introduce some artifacts. Artifacts with a reduction range of 1:10 generally do not impact the computer vision algorithms. For example, reducing a mesh corresponding to the 3D model of a whole car from 500,000 polygons to 50,000 polygons produced a significantly reduced dataset, and still achieved good detection and tracking performance.

A number of tools, such as Simplygon, Blender, Maya, Umbra3D, and MeshLab, are available for download. Please refer to the official documentation of your specific tool for more information.

Modification

In some cases, the 3D model of an object can contain parts that are not on the object being tracked (or not on all instances). Think of an optional extra when ordering an item. Ideally, the 3D model used for tracking does not contain this part. One example would be extra footrests, or a passenger seat on a motorbike.

In addition, parts that can easily move from their position in the 3D model (e.g. a steering wheel that can be rotated or adjusted to fit the driver) can interfere with tracking. Removing it from the 3D model can improve tracking quality since it decreases the disparities between the 3D model and the real object.

Installation and Setup of the CAD Conversion Environment

The MTG comes in its own package which doesn’t need to be installed. The archive needs to be unzipped and the MTG can be run using the executable file. A basic set of model converters is shipped with the MTG. If JT conversion is required for input, Creo View and the accompanying JT adapter needs to be installed as well. Only when Creo View is able to import JT files can the MTG do so.

Running the CAD Conversion Tool

As long as the source model is of a format that the MTG is able to import, no additional model conversion is needed. The MTG takes care of it automatically when a new project is created, or even when the source file is updated (assuming that the source file is still accessible at the location used upon project creation).

Steps to Using Model Target Generator Tool

1. Launch the tool by double-clicking the Model Target Generator Tool executable

2. Login with your Vuforia Engine Developer account credentials

Vuforia Image

3. Select New Project and make sure the Location is not set to an unmapped network path. You can also open previously created projects by selecting Open Project. 

Vuforia Image
Vuforia Image

4.  Enter a Project Name

Vuforia Image

5. Using CAD Model -> Select…, open the VuforiaMars_ModelTarget.pvz file from the prepackaged VuforiaMars_ModelTarget folder

Vuforia Image

6. Select Create Project

Vuforia Image

It may take a few moments to load your model.

Vuforia Image

7. You will see your model rendered in the MTG CAD Model View 

Vuforia Image

The tools at the top left enable you to rotate, scale, and translate the model. The size of the target needs to match the size of the object in real life

8. Using the gear icon in the upper right Gear icon, set the unit that you want the dimensions of your target defined in (a real car is a couple of m, a toy car is tens of cm). If the size is wrong you might need to go back to the tool you use to edit the CAD model with and change the size there. Some file formats like .obj are unit agnostic. Also, you need to pay attention to this aspect later on when importing the target into Unity, to make sure that the scale is consistent.

Vuforia Image

9 Using the gear icon Gear icon, select the Up Vector axis for your model

Vuforia Image

10. Set the Detection Position for your AR experience

This is the view of the physical object that is used to detect the object and initialize the Model Target Tracker.

Choosing the Detection position is a very important step for successful detection later on when using the Model Targets at runtime in the application. 

Vuforia Image

For stable detection, detection positions with a fronto-parallel view onto the object should be avoided. If possible, choose a position with a diagonal view, such that two or three sides of the object can be seen. Additionally, detection positions with many parallel lines should be avoided.
For smaller objects, detection positions where the object only fills a small part of the image should be avoided.
In the Model Targets Generator, when pressed, the Set Detection Position will render an outline of your model from the selected perspective and generate a bitmap of this image in your project directory.

We recommend that you use this image to guide users to view your object from the correct perspective, in order to successfully initiate your AR experience.

Vuforia Image

Review the Unity Model Target Sample to see how these images are used to within the user experience of a Model Target application.

The Detection Position can be set in either Portrait or Landscape modes.

11. Press Generate Model Target and confirm to generate a Model Target Dataset

Vuforia Image

You will see a progress counter, indicating that the dataset is being generated.

Vuforia Image

12. You will find your newly generate target dataset in the dataset folder under the project location previously set, within a [project-name]/dataset path.

Vuforia Image

Use the *.unitypackage in this folder for Unity project – you can simply import this package to configure your project for the target dataset.

Use the *.dat and *.xml files for apps developed with the Vuforia Engine native SDKs.

Use the PNG files to design user interface elements that guide users to correctly align the camera with the objects used by your app.

Using the Tool’s Output File

There are several files the MTG produces upon dataset creation:

  • <ProjectName>.xml & <ProjectName>.dat: The Vuforia Engine native dataset. Use these two files in the same way in your application as any other Vuforia Engine dataset.
  • <ProjectName>.unitypackage: The native dataset packaged so it can be used within a Unity application running the Vuforia Engine plugin.
  • PNG image files: renderings of the model from the position and orientation of the guide view. These files are not required to be used within a Vuforia Model Target Tracking application, however, if the default guide view (line rendering) is not of the visual quality the application developer requires, the files can be used as a reference view for touching up or re-drawing the guide view by an artist. For this case, the app developer needs to package and load the revised guide view with the app separately.

 

Learn More