Reputation: 1189
How do I get the 2D screen coordinates of a 3D object when using Papervision 2.0 (Great White)? I've read that following properties should return the screen coords but these always return 0.
myDisplayObject3D.screen.x
myDisplayObject3D.screen.y
I've also tried setting:
myDisplayObject3D.autoCalcScreenCoords = true;
But this has no effect. Any help would be appreciated.
Upvotes: 2
Views: 1341
Reputation: 1189
Turns out I was attempting to read the values immediately after adding the object to the scene but BEFORE the renderers next render cycle. I added the above code to my enter frame listener and all subsequent traces worked correctly.
Upvotes: 1
Reputation: 51847
screen.x and screen.y should work. Is your 3d object added to the scene ?
In the online articles(pv3d.org, everydayflash) all looks fine.
Could you post a snippet ( either isolate the bit of code, either write a simple analogy to your situation) so we can get a clue of what might be wrong ?
Upvotes: 0