getWorldTranslation on TriMesh returns 0,0,0?

I'm attempting to draw an ortho_queue quad (for a hud like thing) relative to a TriMesh using coordinates derived from basically the following:



Vector3f wcTM = TM.getWorldTranslation();

Vector3f camWCTM = renderer.getCamera().getScreenCoordinates(wcTM);



However, getWorldTranslation is returning a Vector3f of 0,0,0 and thus the call to getScreenCoordinates fails.  In order to see if there was something wrong with my TriMesh I created a regular Node consisting of Box() at the TriMesh's location and the same WorldTranslation is returned.  (Of course, the TriMesh and Box are not at 0,0,0 in the world!)  Any ideas?  Is there an update call that I might be missing?  This is a StandardGame and I have called updateGeometricState on the root node…


After calling updateGeometricState on the spatial with a local translation set the world translation should be updated. Check that i.e. you spatial really resides in the root node.

irrisor said:

After calling updateGeometricState on the spatial with a local translation set the world translation should be updated. Check that i.e. you spatial really resides in the root node.


Okay... it looks like a had a couple of different problems going on here.  The first was that because the TriMesh is a child of a model/node it's local translation could not be obtained directly but only through its bounding volume.  The second was that the box that I created to test the getWorldTranslation issue and positioned according to the center of the TriMesh's bounding volume was only positioned via its creation method and not a direct call to setLocalTranslation.  So, once I set the box's local translation directly and then called getWorldTranslation on it, the proper Vector3f was returned.  So ARGHH! ;)  The latter case is more realistic for my current endeavor and the use of the TriMesh was only to "sketch out" what I wanted to do before actually doing it. 

Thanks!