x


Debug Vertices?

In Unity IDE: Is there a way to "debug" vertices by showing where they are? Similar to how you can debug raycast by using debug to draw a line.

Is there something less "hack-ish" than instantiating a tiny prefab point at every single vertex?

more ▼

asked Jan 01 '11 at 06:28 AM

ina gravatar image

ina
3.3k 492 549 597

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

http://unity3d.com/support/documentation/ScriptReference/Gizmos.html

var color = Color.white;
var radius = .001;

function OnDrawGizmos () {
    Gizmos.color = color;
    var transform = this.transform;
    for (var vert in GetComponent.<MeshFilter>().sharedMesh.vertices) 
        Gizmos.DrawWireSphere(transform.TransformPoint(vert), radius);
}
more ▼

answered Jan 01 '11 at 07:09 AM

Jessy gravatar image

Jessy
15.6k 72 95 196

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x300
x239
x139
x54

asked: Jan 01 '11 at 06:28 AM

Seen: 542 times

Last Updated: Jan 01 '11 at 06:28 AM