WorldToScreenPoint - extreme values

77 visualitzacions
Ves al primer missatge no llegit

John Grden

no llegida,
7 de febr. 2011, 14:28:507/2/11
a 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

no llegida,
7 de febr. 2011, 15:31:597/2/11
a 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

Respon a tots
Respon a l'autor
Reenvia
0 missatges nous