# ViewportToScreenPoint(Vector3)

> Transforms position from viewport space into screen space.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.5/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public Vector3 ViewportToScreenPoint(Vector3 position)
```

### Parameters

**** (\[Vector3]\(/engine/6000.5/script-reference/unityengine/vector3)):&#x20;

### Returns

| Type                                                              | Description |
| ----------------------------------------------------------------- | ----------- |
| [Vector3](/engine/6000.5/script-reference/unityengine/vector3.md) |             |

### Remarks

Viewport space is normalized and relative to the camera. The bottom-left of the camera is (0,0); the top-right is (1,1). The z position is in world units from the camera.

Screen space is defined in pixels. The bottom-left of the screen is (0,0); the right-top is ([Camera.pixelWidth](/engine/6000.5/script-reference/unityengine/camera/pixelwidth.md),[Camera.pixelHeight](/engine/6000.5/script-reference/unityengine/camera/pixelheight.md)). The z position is in world units from the camera.

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    // Draw an image based on normalized view coordinates
    // rather than pixel positions.
    Texture2D bottomPanel;

    void VPToScreenPtExample()
    {
        var origin = Camera.main.ViewportToScreenPoint(new Vector3(0.25f, 0.1f, 0));
        var extent = Camera.main.ViewportToScreenPoint(new Vector3(0.5f, 0.2f, 0));

        GUI.DrawTexture(new Rect(origin.x, origin.y, extent.x, extent.y), bottomPanel);
    }
}
```
