WorldToScreenPoint - extreme values

75 views
Skip to first unread message

John Grden

unread,
Feb 7, 2011, 2:28:50 PM2/7/11
to unity3d-d...@googlegroups.com
Anyone any idea why my values are coming back in the thousands?  I've confirmed that "pos's" values are correct in world space, none of the gameObjects are scaled (scale=1 on all), and yet for a resolution of 1024x768, I'm getting back values that are very high - see below:

private void SetDotScreenPosition(int currentDot, Vector3 pos, LineRenderer point)
{
    pos = point.transform.TransformPoint(pos); // these values are verified as correct in world space
    Vector3 screenPos = cam.WorldToScreenPoint(pos);
    Debug.Log("SCREENPOS: " + screenPos.ToString() + ", POS: " + pos);
}

// output:
SCREENPOS: (2823.3, 540.1, 10.0), POS: (114.2, 3.7, 0.0)

any ideas on what i'm missing here?

Im running RC3 btw

Thanks all,

John

--
[  JPG  ]

Elliott Mitchell

unread,
Feb 7, 2011, 3:31:59 PM2/7/11
to unity3d-d...@googlegroups.com
I don't know,  maybe either contents of the gameObjects are scaled or there could be transform data on a parent group or something?  

-Elliott


--
You received this message because you are subscribed to the Google
Groups "Unity3D Developers" group.
To post to this group, send email to unity3d-d...@googlegroups.com
To unsubscribe from this group, send email to
unity3d-develop...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/unity3d-developers?hl=en

Reply all
Reply to author
Forward
0 new messages