> For the complete documentation index, see [llms.txt](https://ms-kb.msd.unimelb.edu.au/next-lab/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ms-kb.msd.unimelb.edu.au/next-lab/augmented-reality/guides/unity-and-vuforia-1/vuforia-primer/model-recognition.md).

# Model Recognition

{% hint style="info" %}
This is a **Work in Progress Article** based on materials available on the [Vuforia Library](https://library.vuforia.com/content/vuforia-library/en/features/objects/model-targets.html).
{% endhint %}

## Model Targets

![Introduction to Model Targets in Unity (Source: Vuforia Library)](https://library.vuforia.com/content/dam/vuforia-library/articles/solution/unity-model-target/mt_gif_02-optimized.gif)

**Model Targets** utilise **3D model data** of an object (for example a 3D Scan or Digital Model).&#x20;

Model Targets enable applications to **track physical objects** by using this digital data as reference information. Model targets can include rigid and opaque objects of different scales, from **Architectual Landmarks** to **Small Figurines.**

### Requirements: Model Data

In order to create a **Model Target**, 3D model data must first be created. **3D CAD models** and **3D Scans** are suitable data sources.&#x20;

Students at MSD can [learn more about Digital Reproduction](/next-lab/3d-scanning/digital-reconstruction-at-the-next-lab.md) on the **Knowledge Base** and can **access** **training and equipment loans** using [SimplyBookMe](https://msdunimelb.simplybook.me/v2/#book/location/2/).

The **Model Target** itself must be a **rigid object** which **does not contain** transparent or shiny surfaces. The object must also **remain in a fixed location**.

See: [Model Targets Supported Objects & CAD Model Best Practices (Vuforia Library)](https://library.vuforia.com/content/vuforia-library/en/articles/Solution/model-targets-supported-objects.html)

## Creating Model Targets

**Model Targets** are created using the [**Model Target Generator**](https://developer.vuforia.com/downloads/tool). This software converts a **3D model** in to a **Vuforia Engine dataset**. This software is **only available on Windows**.

![Figure 1.0 - Vuforia Model Target Generator ](/files/-LYeMJDVJSIkmkto_SEX)

**The Model Target Generator** software will grade quality or suitability of the mesh, and allow a user to add **"Guide Views"** . This Guide View is an **outline** of a 3D model from a **particular perspective**.

From the **Model Target Generator,** you can export your Model Target **dataset** as a `.unitypackage`.

**Import** the `.unitypackage` in to your **Unity Project**.

## Using Model Targets in Unity

**Model Targets** can be added in to a **Unity Scene** as `GameObjects`.&#x20;

`GameObject > Vuforia Engine > Model Targets > Model Target`

Add an ARCamera to the Environment and enter an appropriate license key. [Read more here](/next-lab/augmented-reality/guides/unity-and-vuforia-1/vuforia-primer.md#1-0-the-ar-camera).

**Select** the `ModelTarget` from the **Hierarchy Window**, and designate it a `child` of the `ARCamera`.

**Ensure** that the **Model Target Behaviour scripts** are correct:\
`Inspector Window > Model Target Behaviour (Script)`

* The `Database` and `Model Target` fields should match that of the **recently imported database**&#x20;
* The `Physical Length`, `Physical Width` and `Physical Height` fields should **match** the **physical dimensions** of the **real-world** **object** that the **project references**.
* The `Guide View Mode` field should be set to `Guide View 2D`

**Debug the application**, and verify that when the **Guide View** aligns with the **physical object**, the guide view lines disappear.

When this occurs, the application is **tracking** the **physical object**.

## Adding Content to the ModelTarget

**Content**, such as a **rendered 3d model** or **annotations** can be **rendered** upon the application **tracking the object**.

Add any asset or **GameObject** to the **hierarchy window** and designate it a **child** of the **ModelTarget.**

## Other Resources

[Model Targets](https://library.vuforia.com/content/vuforia-library/en/features/objects/model-targets.html) (Vuforia Library)

{% embed url="<https://library.vuforia.com/content/vuforia-library/en/features/objects/model-targets.html>" %}

[Vuforia Model Target Generator](https://developer.vuforia.com/downloads/tool) (Vuforia Developer Portal)

{% embed url="<https://developer.vuforia.com/downloads/tool>" %}

[An Introduction to Model Targets in Unity](https://library.vuforia.com/content/vuforia-library/en/articles/Solution/introduction-model-targets-unity.html) (Vuforia Developer Library)

{% embed url="<https://library.vuforia.com/content/vuforia-library/en/articles/Solution/introduction-model-targets-unity.html>" %}
