Getting all the vertices of a geodesicSphere

Software: Away3D 3.x

Slayer, Newbie
Posted: 07 July 2012 06:05 PM   Total Posts: 3

Hi, I’m working on a project where I need to place an icon on every vertice of a geodesicSphere.

The sphere is there just so I can get the vertices coordinates, the problem is I don’t understand how I should do it.

I’m using 3.6 and I really need your help. I know it can’t be that hard, I just can’t figure it out on myself.

If you’re kind enough to help me please explain the process in detail (:

   

Richard Olsson, Administrator
Posted: 07 July 2012 06:27 PM   Total Posts: 1192   [ # 1 ]

Use the vertices getter on the mesh, which contains a vector of Vertex objects. Each Vertex object has x, y and z properties defining the position.

// Do this in a loop and use the x/y/z properties however you want.
var vtx Vertex mySphere.vertices[0];
trace(vtx.xvtx.yvtx.z); 
   

Slayer, Newbie
Posted: 07 July 2012 08:21 PM   Total Posts: 3   [ # 2 ]

Thanks Richard, works perfectly.

However when I posted this I didn’t know about the world space and object space. The point of this project is to create an interactive 3d sphere menu, where the sphere spins. Your code works but the vertices coordinates do not update when the sphere is rotating. I know the fault is mine because I didn’t specify that the object would be rotating.

I saw this post on the forums but I do not understand how I should setup alejandro’s code. Sorry to bother you again, I hope you can help me

http://away3d.com/forum/viewthread/885/#3011

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X