Page 1 of 1

how transform screen coordinates into scene node coordinates

Posted: Mon Feb 27, 2006 3:41 pm
by warden
Hi,

i want to check in what orientational relation a certain pixel is from a certain scene node and furthermore move the scene node to that position.

the scene node may be a child from the camera at x,y,z

my input coordinates are x=-1..0..1 and y=-1..0..1 on the screen. i could switch to pixels as well (i.e. 0..1280*0..1024).

how do i transform those input coordinates into the coordinate space of the scene node?? i currently have no clue how to do that.

could anyone of you guys plz help me out?

thanx a lot!
warden

Posted: Mon Feb 27, 2006 6:54 pm
by vitek
If you have a 2d screen coordinate the best that you can do is get a 3d line that goes from the camera position through that screen position. Have a look at the getRayFromScreenCoordinates and getScreenCoordinatesFrom3DPosition methods of the ISceneCollisionManager interface.