Screen coordinates of a 3d object in away3dlite

8 views
Skip to first unread message

scarter

unread,
Dec 2, 2009, 6:39:52 PM12/2/09
to away3d.dev
I was wondering if there was a function in away3dlite similar to
camera.screen() function in away3d that would return the screen
coordinates of an object. I saw some earlier posts regarding this but
I can't seem to find anything simliar in the lite code base.

BTW, loving the speed increase in 3Dlite.

Thanks,
Shan

astrocreep

unread,
Dec 3, 2009, 6:19:56 AM12/3/09
to away3d.dev
var screenX:Number = do3d.viewMatrix3D.position.x /
do3d.viewMatrix3D.position.z;
var screenY:Number = do3d.viewMatrix3D.position.y /
do3d.viewMatrix3D.position.z;

scarter

unread,
Dec 3, 2009, 5:07:11 PM12/3/09
to away3d.dev
This didn't seem to work for me. I'm trying to use it on a cube
primitive, but when I try to access the "position.x" property (or the
y or the z) it returns this error:
"TypeError: Error #1010: A term is undefined and has no properties."

I have it running just after the render call in my onEnterFrame
function.

Any thoughts?

scarter

unread,
Dec 3, 2009, 5:29:26 PM12/3/09
to away3d.dev
Sorry, this problem was something on my end. Your suggestion worked
perfectly. Thanks a ton!

Best,
Shan
Reply all
Reply to author
Forward
0 new messages