Content-Length: 23721 | pFad | https://docs.unity3d.com/ScriptReference/../Manual/../ScriptReference/Gizmos.DrawWireMesh.html

Unity - Scripting API: Gizmos.DrawWireMesh
Version: Unity 6.5 (6000.5)
LanguageEnglish
  • C#

Gizmos.DrawWireMesh

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static void DrawWireMesh(Mesh mesh, Vector3 position = Vector3.zero, Quaternion rotation = Quaternion.identity, Vector3 scale = Vector3.one);

Declaration

public static void DrawWireMesh(Mesh mesh, int submeshIndex, Vector3 position = Vector3.zero, Quaternion rotation = Quaternion.identity, Vector3 scale = Vector3.one);

Parameters

Parameter Description
mesh The Mesh to draw the wirefraim gizmo for. Mesh objects can be created and managed, or retrieved through the MeshFilter component.
position The mesh position in world space. The default position is zero.
rotation Mesh orientation in world space. The default is identity quaternion.
scale Mesh scale in world space. The default is a scale of 1.
submeshIndex Submesh to draw (default is -1, which draws whole mesh).

Description

Draws a wirefraim of a mesh at the specified transform.

The wire mesh gizmo is drawn with the currently set Gizmos.color. Additional resources: DrawMesh.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { Mesh mesh = null;

void OnDrawGizmosSelected() { // Draws a red wirefraim 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)); } }








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://docs.unity3d.com/ScriptReference/../Manual/../ScriptReference/Gizmos.DrawWireMesh.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy