How to place a node under the mouse pointer?
-
- Posts: 162
- Joined: Wed Nov 26, 2003 5:24 pm
- Location: Europe
How to place a node under the mouse pointer?
Please help! I need to make my particle node to follow the mouse pointer. What is the best way to do that? In Blitz3D I could place a plane in front of the camera, calculate the coordinates of the collision with that plane using screen coordinates and thus taking these 3d coordinates. Will such a method work in Irrlischt? Maybe there is an easier way?
http://www.javazing.com
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6
Get the collision manager from the scene manager (smgr->getCollisionManager()). Cast out a ray to get the line 3d line the mouse is currently over (cmgr->getRayFromScreenCoordinates(cursor->getPosition())). Then just determine how far along the ray you want to go (I suppose the same way you determined how far out to place your plane in Blitz3D).
-
- Posts: 162
- Joined: Wed Nov 26, 2003 5:24 pm
- Location: Europe
Thanks a lot!
http://www.javazing.com
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6
Re: How to place a node under the mouse pointer?
You mean, like in collision example?Serg Nechaeff wrote:Please help! I need to make my particle node to follow the mouse pointer. What is the best way to do that? In Blitz3D I could place a plane in front of the camera, calculate the coordinates of the collision with that plane using screen coordinates and thus taking these 3d coordinates. Will such a method work in Irrlischt? Maybe there is an easier way?
-
- Posts: 162
- Joined: Wed Nov 26, 2003 5:24 pm
- Location: Europe
Oh god, I KNEW I saw it somewhere thanx!
http://www.javazing.com
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6