object world position

can anyone tell me how to get an objects absolute world postion? stuck alittle here :slight_smile:

  • always the simple things

Two options:

  1. on live Node (say, Shape3D) use getLocalToVworld() and you will get accumulated Transform3D for the node. This will give you position of the center of local coordinates.

  2. Use getVworldBounds() on live Node to get BoundingSphere, so you can get coordinates of the center of your object.

Yuri

Transform3D loc = new Transform3D();
Vector3f q1 = new Vector3f();
bRoteGroup.getLocalToVworld(loc);
loc.get(q1);
return(new float[] {q1.x,q1.y,q1.z});

i still get 0,0,0 :frowning:

think i got it :slight_smile: nice one Yuri

Vector3f q1 = bTransGroup.getVworldBounds().getCenter();

tops- gotting to see if it makes sence now… could have some very cool news for u on the sound angle :slight_smile:

in the new cvs build - we get a Point3f now (was a Vector3f- the Point3f never seems to change after a transformation has taken place :frowning:

darn- was going to get the fmod working today… gurrr

Can you make a test case, so I can take a look?

This is strange that getLocalToVworld does not work. Are you sure that you are doing this on live Node?

Yuri