# DrawWireMesh

> Draws a wireframe of a mesh at the specified transform.

## Definition

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

## DrawWireMesh(Mesh, int, Vector3, Quaternion, Vector3)

Draws a wireframe of a mesh at the specified transform.

```csharp
public static void DrawWireMesh(Mesh mesh, int submeshIndex, Vector3 position, Quaternion rotation, Vector3 scale)
```

### Parameters

**** (\[Mesh]\(/engine/6000.7/script-reference/unityengine/mesh)): The [Mesh](/engine/6000.7/script-reference/unityengine/mesh.md) to draw the wireframe gizmo for. Mesh objects can be created and managed, or retrieved through the [MeshFilter](/engine/6000.7/script-reference/unityengine/meshfilter.md) component.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Submesh to draw (default is -1, which draws whole mesh).**** (\[Vector3]\(/engine/6000.7/script-reference/unityengine/vector3)): The mesh position in world space. The default position is zero.**** (\[Quaternion]\(/engine/6000.7/script-reference/unityengine/quaternion)): Mesh orientation in world space. The default is identity quaternion.**** (\[Vector3]\(/engine/6000.7/script-reference/unityengine/vector3)): Mesh scale in world space. The default is a scale of 1.

### Remarks

The wire mesh gizmo is drawn with the currently set [Gizmos.color](/engine/6000.7/script-reference/unityengine/gizmos/color.md). Additional Resources: [Gizmos.DrawMesh](/engine/6000.7/script-reference/unityengine/gizmos/drawmesh.md).

### Examples

```csharp
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    Mesh mesh = null;

    void OnDrawGizmosSelected()
    {
        // Draws a red wireframe of a Cube at the position of the object rotated by 45 degrees around the Y axis.
        if (mesh is null)
            mesh = Resources.GetBuiltinResource<Mesh>("Cube.fbx");
        Gizmos.color = Color.red;
        Gizmos.DrawWireMesh(mesh, transform.position, Quaternion.Euler(0f, 45f, 0f));
    }
}
```

## DrawWireMesh(Mesh, Vector3, Quaternion, Vector3)

Draws a wireframe of a mesh at the specified transform.

```csharp
public static void DrawWireMesh(Mesh mesh, Vector3 position, Quaternion rotation, Vector3 scale)
```

### Parameters

**** (\[Mesh]\(/engine/6000.7/script-reference/unityengine/mesh)): The [Mesh](/engine/6000.7/script-reference/unityengine/mesh.md) to draw the wireframe gizmo for. Mesh objects can be created and managed, or retrieved through the [MeshFilter](/engine/6000.7/script-reference/unityengine/meshfilter.md) component.**** (\[Vector3]\(/engine/6000.7/script-reference/unityengine/vector3)): The mesh position in world space. The default position is zero.**** (\[Quaternion]\(/engine/6000.7/script-reference/unityengine/quaternion)): Mesh orientation in world space. The default is identity quaternion.**** (\[Vector3]\(/engine/6000.7/script-reference/unityengine/vector3)): Mesh scale in world space. The default is a scale of 1.

### Remarks

The wire mesh gizmo is drawn with the currently set [Gizmos.color](/engine/6000.7/script-reference/unityengine/gizmos/color.md). Additional Resources: [Gizmos.DrawMesh](/engine/6000.7/script-reference/unityengine/gizmos/drawmesh.md).

### Examples

```csharp
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    Mesh mesh = null;

    void OnDrawGizmosSelected()
    {
        // Draws a red wireframe of a Cube at the position of the object rotated by 45 degrees around the Y axis.
        if (mesh is null)
            mesh = Resources.GetBuiltinResource<Mesh>("Cube.fbx");
        Gizmos.color = Color.red;
        Gizmos.DrawWireMesh(mesh, transform.position, Quaternion.Euler(0f, 45f, 0f));
    }
}
```
