How to get coordinate of vertexts from CubeGeometry?

Software: Away3D 4.x

V達, Newbie
Posted: 28 May 2012 09:37 AM   Total Posts: 3

How to get coordinate of vertexts from CubeGeometry?

   

Richard Olsson, Administrator
Posted: 16 June 2012 01:47 PM   Total Posts: 1192   [ # 1 ]

You need to make sure you understand how the vertices vector of your CubeGeometry’s sub-geometries work. Every vertex is represented by a triplet of numbers where the first represents the vertex’s x position, the second represents the y position and the third represents the z position. So if you want to get the position of the first vertex, you do this:

var x = myGeom.subGeometries[0].vertexData[0];
var y = myGeom.subGeometries[0].vertexData[1];
var z = myGeom.subGeometries[0].vertexData[2];

If you need it to be in scene space you can convert these values using the sceneTransform matrix of your Mesh.

   
   
‹‹ AWD2 exporter for Maya

X

Away3D Forum

Member Login

Username

Password

Remember_me



X