- Home /
how do you find the number of each vertex in a primative cube?
What might I be able to do to get the vertex number for each vert. Im trying to scale just one face out of the cube so I need to know which vertices to scale.
Answer by Graham-Dunnett · Jul 14, 2011 at 10:55 AM
Think you can simply do a little experimentation and figure out the order. You know the object is a cube, so ought to be able to find vertices that all have the same x value, the same y value, or the same z value. You ought to be able to work out the vertex ordering from this.
Or just look at the normals each vertex has. The normals are surely (1,0,0) or (-1,0,0) and so on. Vertices on the same face will share the same normal.
Answer by DaveA · Jul 13, 2011 at 07:17 PM
I suppose you could model a cube in such a way as that you know the vertex ordering, but you'd have to hope that's preserved on import. Like Collada or OBJ or something.
You could write a little script that tests each vertex to see which face it's on, compare it to the bounding box to get which face it's on.
I meant Unity primitives, I didnt want to use an imported cube. As far as I know you cant export unity primitives to fbx or obj.