Author Topic: Ngui camera screentoworldpoint  (Read 3667 times)

oguztecimer

  • Guest
Ngui camera screentoworldpoint
« on: December 22, 2013, 04:25:34 AM »
Hello, i need to change the position of an object by taking reference from main camera. I need to find its position on ngui camera and to do that i am using;
nguiCamera.screenToWorldPoint(mainCamera.worldToScreenPoint( objectPosition ))

mainCamera.worldToScreenPoint returns the right value, but nguiCamera.screenToWorldPoint returns a really absurd value. I also tried entering the values manually but i get values like (9999,0.1,0) where it should return (0,0,0).

I know its not very clear but i can give more information if you need.

Thank you,
Oguz Tecimer

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Ngui camera screentoworldpoint
« Reply #1 on: December 22, 2013, 11:58:31 AM »
It should work fine. I'd use WorldToViewportPoint/ViewportToWorldPoint, however.