Ignacio García a écrit :
If you want the gun controlled by the mouse movement, take a look at the
drive manipulator: it is not exactly what you want, but changes the camera
position depending on the mouse position on screen. You would have to adapt
it to change the gun position.
I would rather suggest to write a new Event handler for the gun stuffs
and to use the drive manipulator as-is . At least, keeping apart these
two aspect would probably be more flexible.
If you want the mouse to be the target point, you can watch the osgPick
example to see how to know which node/drawable of the scene is being pointed
by the mouse, so that you know where the bullets are going (and how to get
the gun pointing there).
________________________________________
De: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] En nombre de Ivan Bolcina
Enviado el: jueves, 19 de octubre de 2006 10:29
Para: osg users
Asunto: [osg-users] Vector of mouse coordinate on screen
Hi.
I have a mouse cursor.
I want to know the vector it is pointing to.
Like if the center of sceen is aligned to vehicle I am driving (Y part of
rotation matrix), then where is mouse aiming at. This would be used for a
gun mounter on vehiche. The gun would be controled using a mouse, a vehicle
using a keyboard.
Can you help me with algorithm of some sort?
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
---------------------------------------------------------------------------------------
Orange vous informe que cet e-mail a ete controle par l'anti-virus mail.
Aucun virus connu a ce jour par nos services n'a ete detecte.
--
Remy Deslignes
Ingenieur Developement / Software Engineer
Tel: +33 (0)1.53.90.11.19
===========================================
Silicon Worlds S.A.
12, rue de Chatillon
75014 Paris France
Tel: +33 (0)1.53.90.11.11
Fax: +33 (0)1.53.90.11.12
http://www.silicon-worlds.fr
===========================================
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/