How to get coordinate of vertexts from CubeGeometry?
How to get coordinate of vertexts from CubeGeometry?Software: Away3D 4.x |
||
|
||
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]; If you need it to be in scene space you can convert these values using the sceneTransform matrix of your Mesh. |