> For the complete documentation index, see [llms.txt](https://stage-precision.gitbook.io/grid/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stage-precision.gitbook.io/grid/touch-designer-integration/camera-tracking/your-first-tracked-camera.md).

# Your first tracked camera

Receive your first camera from Grid Studio and use it to render a simple TouchDesigner scene.

This example connects a camera in Grid Studio to TouchDesigner and uses it to render a cube.

### 1. Prepare the camera in Grid Studio

Configure Grid Studio to send a standard camera over SPNet.

For this example, use:

| Setting     | Value          |
| ----------- | -------------- |
| Camera ID   | `1`            |
| Destination | `237.37.37.37` |
| UDP port    | `37373`        |

### 2. Add the SPNet Camera CHOP

In TouchDesigner:

1. Open the **OP Create Dialog**.
2. Select **Custom** and search for `SPNet Camera`.

   <div align="left"><figure><img src="https://2603562454-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpqFgDkRbISUDHHzKu5sG%2Fuploads%2FpnVuAWzJdgherTkQFSpl%2Fimage.png?alt=media&amp;token=4454ee42-da8b-4402-9ea0-e06e46c36b83" alt="" width="449"><figcaption></figcaption></figure></div>
3. Add the CHOP to your network.
4. On its **Camera** page, set **Camera ID** to `1`.

   <div align="left"><figure><img src="https://2603562454-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpqFgDkRbISUDHHzKu5sG%2Fuploads%2FbgA3GEgSvJD0mGDhTDxL%2Fimage.png?alt=media&amp;token=20a4199f-9710-4620-a3d8-970b4be2b82f" alt="" width="374"><figcaption></figcaption></figure></div>

{% hint style="warning" %}
The ID must match the camera being sent by Grid Studio.
{% endhint %}

Open the **Connection** page and use:

<div align="left"><figure><img src="https://2603562454-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpqFgDkRbISUDHHzKu5sG%2Fuploads%2FJyYIJY8Uhv52uUicJsGc%2Fimage.png?alt=media&amp;token=6b5900b5-3f2e-42b9-ae28-c520d3740e3e" alt="" width="374"><figcaption></figcaption></figure></div>

| Parameter         | Value          |
| ----------------- | -------------- |
| Port              | `37373`        |
| Bind Address      | `0.0.0.0`      |
| Multicast Group   | `237.37.37.37` |
| Interface Address | `0.0.0.0`      |

{% hint style="info" %}
If your computer has multiple network adapters, set Interface Address to the local IPv4 address of the adapter receiving SPNet. This is the TouchDesigner computer's address.
{% endhint %}

Once data arrives, the CHOP displays the camera channels. Move the camera in Grid Studio and check that the position and rotation values change.

### 3. Find the camera rig

A camera rig is generated automatically beside the SPNet Camera CHOP.

<div align="left"><figure><img src="https://2603562454-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpqFgDkRbISUDHHzKu5sG%2Fuploads%2FlAUUK3yJfj4DrwT0N0EM%2FPowerToys_AcTFU8N796.gif?alt=media&amp;token=c90a1c44-fc9a-4954-9327-0e89ac5ac9aa" alt="" width="563"><figcaption></figcaption></figure></div>

Its name follows the source node's name:

```
Spnetcamera1
Spnetcamera1_rig
```

The CHOP displays numeric data. The rig displays the rendered image.

If the rig is missing, press **Create Camera Rig** on the CHOP's **Camera** page.

The rig already contains the camera, rendering setup, and native lens distortion TOP. Their connections are configured automatically.

### 4. Add a test object

Use the existing `geo1` from the default TouchDesigner scene, or create a Geometry COMP named `geo1` containing a Box SOP.

For a simple test:

1. Set the box dimensions to `1 × 1 × 1`.
2. Keep the geometry at the world origin.
3. Enable the geometry's Render flag.
4. Create a Constant MAT and assign it to the Geometry COMP's **Material** parameter.

The Constant MAT makes the cube visible without adding lights.

Select the camera rig and open its **Scene** page. Set **Geometry** to your Geometry COMP's absolute path, for example:

```
/project1/geo1
```

### 5. View the scene

On the rig's **Camera** page, leave these options enabled:

* **Use Position**
* **Use Rotation**
* **Use FOV**

In Grid Studio, position and rotate the camera so it faces the cube at the world origin.

The rig's viewer should now show the cube. Move or rotate the camera in Grid Studio to change the viewpoint in TouchDesigner.

You can also enter the rig and view its final image through the `out1` TOP.

### 6. Set the output resolution

Select the SPNet Camera CHOP and open its **Output** page.

Set **Output Width** and **Output Height** to the required final image size. For example:

| Parameter     | Value  |
| ------------- | ------ |
| Output Width  | `1920` |
| Output Height | `1080` |

The standard SPNet camera does not transmit pixel resolution, so these values are configured in TouchDesigner. The actual resolution remains subject to your TouchDesigner license limits.

Leave **Overscan Override** enabled at its default factor of `1.1` for this example.

### Check the result

You should now have:

* Live camera data in the SPNet Camera CHOP.
* A camera rig showing your scene.
* Camera movement and field of view following Grid Studio.

If the image is empty, check the rig's **Geometry** path, the object's Render flag, and whether the camera is facing the object.

{% hint style="info" %}
For an additional reference, enable Debug Mode on the rig's Scene page. This adds a floor grid with one-meter spacing and world axes to the rendered scene.
{% endhint %}
