 |
Author |
Topic: inverse of screenX (Read 1042 times) |
|
charmhaste
|
inverse of screenX
« on: Apr 1st, 2005, 2:59am » |
|
How could i get the object coordinates of a place that the user is clicking on the screen for a 3D space that has had many transformations already done to it? It seems like I would need some kind of an inverse to the screenX, screenY, and screenZ functions built in. any suggestions?
|
|
|
|
toxi
|
Re: inverse of screenX
« Reply #1 on: Apr 1st, 2005, 10:13am » |
|
AFAIK unfortunately there's no generic way to do this mathematically. the problem always is the inability to compute the correct Z-coordinate from only 2D mouse coordinates. there're however ways to compute a 3D point on a fixed/hardcoded plane in the 3D space, for which in most cases the projection plane is used... this thread has some code demonstrating this procedure. hope it helps... good luck!
|
http://toxi.co.uk/
|
|
|
5cameron
|
Re: inverse of screenX
« Reply #2 on: Apr 1st, 2005, 10:46am » |
|
I think what you might be looking for is the objectX/objectY/objectZ functions. Its a function to unravel all of your translations and rotates so you can do a screenX to get the right values. just do a search for "objectX"
|
|
|
|
|