Page 1 of 1

MOUSE CONTROL

Posted: Wed Nov 15, 2006 7:11 pm
by marcoip
If i want to use mouse to decide the position of the particle system event happened in the 3d space, how can i do?

Please help!!!

Posted: Sat Nov 18, 2006 3:55 am
by juliusctw
can you be a little more specific_

Posted: Tue Nov 28, 2006 5:04 pm
by marcoip
I want to take control of moving the mouse cursor into different position in the 3D space and then produce particle effect in this position of that cursor by clicking mouse button. That means if the mouse cursor is moved by the player in different position, the particle effect also can be produced in that cursor position by clicking the mouse button.


Please suggest some methods to help me! THANKS

Posted: Tue Nov 28, 2006 5:14 pm
by sober
you cannot specify the 3d position of the mouse, because you don't know how far the mouse is into the screen.
The MousePosition mapped onto your screen is on a line between the point of the mouse on the nearplane and a point on the farplane, so you need something to find out where on this line (ray) you want the particle to be.
You need something like a floor or terrain where the user clicks onto, to get a position.
To get that, you need a Ray between the far and nearplane and check where the ray hits the ground.

Edit:

You get that ray by calling getRayFromScreenCoordinates on your scenemanager ( http://irrlicht.sourceforge.net/docu/cl ... er.html#a2 ) and use the line as descriped in the collision tutorial.

Edit2:
Doh, you posted while I was editing ;)

Posted: Tue Nov 28, 2006 5:17 pm
by bitplane
getRayFromScreenCoordinates-
http://irrlicht.sourceforge.net/docu/cl ... er.html#a2
use the same code as in the collision example to position the particle system.

also, this question has been asked lots of times, so it should be easy to find by using the search button... 10 mins of searching beats 2 weeks waiting for an answer!

help!!!

Posted: Thu Dec 28, 2006 10:01 am
by marcoip
I am really no idea to solve thie problem...

When I use the collision tutorial to have a testing for this purpose, I dont know how to apply on it.

Please help!!!!

Posted: Thu Jan 11, 2007 7:54 pm
by pin3
If you're still looking for help with this here's the finds from a search for getRayFromScreenCoordinates:
http://irrlicht.sourceforge.net/phpBB2/ ... de=results

Hm the results don't how. Make the search by yourself using "getRayFromScreenCoordinates" as the keyword

Calin