1
Support / Matching mouse clicks to 3D co-ords
« on: February 05, 2005, 10:57:16 pm »
Hi!
I'm writing an applet where an insect follows mouse clicks.
The camera follows the insect from behind (height -240, distance 300).
To save valuable processing time the flat (ie Y=0) landscape is rendered as one big square with a texture on it.
I can use Interact2D to find the landscape, but how do I get more precise x,y,z 3D co-ords from the 2D (x,y) where the user clicked? I know the y will be 0 but I'm not good enough at maths to work out how to get x & z!
The only way I can think of is breaking the landscape into lots of polys and using Interact2D, but this would play havoc with my processing time!
Can you help?
I'm writing an applet where an insect follows mouse clicks.
The camera follows the insect from behind (height -240, distance 300).
To save valuable processing time the flat (ie Y=0) landscape is rendered as one big square with a texture on it.
I can use Interact2D to find the landscape, but how do I get more precise x,y,z 3D co-ords from the 2D (x,y) where the user clicked? I know the y will be 0 but I'm not good enough at maths to work out how to get x & z!
The only way I can think of is breaking the landscape into lots of polys and using Interact2D, but this would play havoc with my processing time!
Can you help?