get coords from mouse pointer

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
paooolino
Posts: 50
Joined: Wed Dec 21, 2005 12:17 pm
Location: Brescia, Italy
Contact:

get coords from mouse pointer

Post by paooolino »

let us have a flat terrain, this terrain is a scene node containing a mesh.

I'd like to subdivide all (or a part) of this terrain in a grid of cells, so when I roll the mouse over the terrain I can highlight the cell the mouse is in.

How can I do that? How to get the coordinates of the collision point (relative to the terrain mesh) between the ray beginning from the mouse and the terrain mesh?

thankyou
sp00n
Posts: 114
Joined: Wed Sep 13, 2006 9:39 am

Post by sp00n »

if you have a triangles (or planes) your terrain contains then you can use getIntersectionWithLine method. In params will be based on mouse coords.
paooolino
Posts: 50
Joined: Wed Dec 21, 2005 12:17 pm
Location: Brescia, Italy
Contact:

Post by paooolino »

thankyou, good advice :-)
Post Reply