sio2UnProject? Point on a plane from touch position
sio2UnProject? Point on a plane from touch position
Hi
I guess this isn't strictly an SIO2 question but more a general 3d one. Anyway, I want to determine the coordinate that a touch on the screen meets a plane in world space. I'm guessing that I need to use sio2Unproject but I'm not sure what to call it with, or what exactly I get in return. Can anyone help me out?
I guess this isn't strictly an SIO2 question but more a general 3d one. Anyway, I want to determine the coordinate that a touch on the screen meets a plane in world space. I'm guessing that I need to use sio2Unproject but I'm not sure what to call it with, or what exactly I get in return. Can anyone help me out?
Tom- Posts : 13
Join date : 2009-03-23
Re: sio2UnProject? Point on a plane from touch position
I figured it out!
Call it twice with two different Z values and you have your ray!
- Code:
sio2UnProject(touch.x,
touch.y, 0.0f,
sio2->_SIO2camera->mat_modelview,
sio2->_SIO2camera->mat_projection,
sio2->_SIO2window->mat_viewport,
&x1, &y1, &z1);
Call it twice with two different Z values and you have your ray!
Tom- Posts : 13
Join date : 2009-03-23
Similar topics
» sio2UnProject change in 1.4?
» sio2UnProject crashes
» Cube Falling through Plane
» Real quick - plane with alpha texture
» Emitter position
» sio2UnProject crashes
» Cube Falling through Plane
» Real quick - plane with alpha texture
» Emitter position
Permissions in this forum:
You cannot reply to topics in this forum