# 2D to 3D Projection

UDiTH allows you to create custom image projections. 2D images are created with **AdapterForDocuments**, while 360° panoramas are created with **AdapterForLaserScans**.

## Create a Projection

1. Start UDiTH and select your model.

2. Create a projection by selecting **2D to 3D Projection** from the **Add** drop-down in the **Files** tab.

<img src="./media/FilesAdd2Dto3D.png" width="250" height="">
<img src="./media/PictureProjection.png" width="200" height="">

> If you do not enter a name for the projection, the name of the selected image will be used.

3. The selected image will be displayed on the right side.

* You can begin placing projection mapping markers on both the 2D image and in the 3D space of your model.

* It is recommended that you position the camera in the 3D space as close as possible to the location from which the image was taken.

* The algorithm that maps the image into the 3D space calculates several possible orientations of the projection sphere. It then chooses the solution closest to the current camera position.

<img src="./media/image254.png" width="650" height="360">

## Mapping a Projection

1. Create a marker and drag it to the correct position in both the 2D and 3D views.

2. Add up to 4 markers to improve accuracy.

3. Move the camera towards the location from which the picture may have been taken to help ensure that the projection is placed correctly.

4. Recalculate the position.

5. If the image is not placed as required, reposition the markers and recalculate until it is placed correctly.

<table>
<tr><td>

<img src="./media/image256.png" width="44" height="44">

</td><td>

**Adds a selection pin to the 2D mapping view and 3D view**

This feature creates colour-coded mapping markers that can be dragged and positioned accurately in both views. You can place up to 4 markers, with at least 3 usually required for reliable mapping.

</td></tr>
<tr><td>

<img src="./media/image258.png" width="44" height="44">

</td><td>

**Removes a selection pin from the 2D mapping view and 3D view**

</td></tr>
<tr><td>

<img src="./media/image260.png" width="44" height="44">

</td><td>

**Changes the focused node**

Selecting a marker centres both the 3D and 2D views. The marker colour reflects its focus status and is red by default.

</td></tr>

<tr><td>

<img src="./media/ButtonReset.png" width="44" height="44">

</td><td>

**Refreshes the projection using the adjusted or pending measurement nodes**

</td></tr>
</table>

## Picture, 360° Panorama, Orthogonal Drawing

Use the drop-down menu to switch between **Picture**, **360° Panorama**, and **Orthogonal Drawing**. Once a calculation has been carried out for the selected image, you can no longer change the image type.

### Picture

<img src="./media/2Dto3D_Picture.png" width="650" height="">

Pictures are standard 2D images projected into the 3D space. Adjust the **Focal length** setting as required using the control to the right of the mapping buttons. In most cases, the focal length is retrieved automatically from the image metadata.

After the position has been calculated, the camera locks onto the projection sphere and behaves in a similar way to **360° panorama** mode.

<table>
<tr><th><img src="./media/image261.jpg" width="44" height="44"></th><td>

Leave the projection sphere and use the camera as usual.

</td></tr>
<tr><th><img src="./media/image202.png" width="88" height="44"></th><td>

Increases opacity of the projected image.

</td></tr>
</table>

### 360° Panorama

<img src="./media/2Dto3D_Panorama.png" width="650" height="">

After the position has been calculated, the camera is locked to the projection sphere. The following button and slider then appear:

<table>
<tr><td>

<img src="./media/image261.jpg" width="44" height="44">

</td><td>

Leave the projection sphere and use the camera as usual.

</td></tr>
<tr><td>

<img src="./media/image202.png" width="88" height="44">

</td><td>

Increases opacity of the projected image.

</td></tr>
</table>

### Orthogonal Drawing

<img src="./media/Drawing_Orthogonal.png" width="70" height="">

To create a projection of an orthogonal drawing, select **2D** from the breadcrumb menu and then select the required drawing. The drawing opens in a tab. While this tab is active, select **2D to 3D Projection** in the **Files** tab on the right.

<img src="./media/2Dto3D_Orthogonal.png" width="650" height="">

<table>
<tr><th><img src="./media/image267.png" width="66" height="27"></th><td>

Select the plane the drawing should be in.

</td></tr>
</table>

`None` means that the plane is defined by the first three markers.
The other options describe the axes to which the plane belongs, for example the X and Y axes shown in the image above.
