camera.project() in v4

Software: Away3D 4.x

Avatar
alihm, Jr. Member
Posted: 29 September 2012 09:22 AM   Total Posts: 49

I’m trying to get 2D pixel coordinates of an object using camera.project() in Away3d V4.0.9. previously with v3 I had no problem using camera.screen() but after switching to v4 camera.project() is returning strange results and I can’t figure out how to interpret it. here is the code i’m using:

var screenPos:Vector3D _camera.project(new Vector3D(x,y,z)); 

screenPos results when the camera was moving around:

Vector3D(0.007867401517881312, -4.005663053238645, -1304.0257568359375)
Vector3D(0.007378305212570607, -3.9412518905234633, -1324.9017333984375)
Vector3D(0.00691754304533773, -3.880877186789486, -1345.091552734375)
Vector3D(0.006464955631314498, -3.820393738598753, -1365.9486083984375)
Vector3D(0.00605075169317081, -3.7617550021833064, -1386.80029296875)
Vector3D(0.0056908243224703435, -3.704866706827702, -1407.650634765625)
Vector3D(0.0054022447284893796, -3.6496469233949305, -1428.5006103515625)

The numbers doesn’t seem to be pixel coordinates. I couldn’t find anything in the documentation about what these numbers are and how to convert them to screen pixel coordinates. Any help will be greatly appreciated.

   

Avatar
alihm, Jr. Member
Posted: 29 September 2012 09:54 AM   Total Posts: 49   [ # 1 ]

Just figured out I had to use _view.project() instead of _camera.project();
smile

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X