Ivan Bolčina schrieb:
Ok. Yes I will take a look at osgPick. Basically i need a vector where mouse is pointing so that the bullets are assigned that vector for movement.
Hi,

while osgPick will help you to find a vector (or rather a line-segment) that is exactly perpendicular to the screen and starting at the point where the mouse is currently, I do not think that this will be the correct vector for your bullets. If you do this, your bullets will fly like this:

||||||||||||||||||||||||| (Bullets)
------------- (Screen)

Your gun has a fixed length, and the vector of your bullets is given by the direction of your gun. If the gun is fixed somewhere, the points the other end of the gun can reach lie on a sphere. So you might be better of by using the mouse-coordinates to compute some spherical coordinates for your gun.

\ | / (Bullets)
----------------------- (Screen)

Regards,

Andreas



_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to