Hi guys, i'd like to shoot a projectile (ball, square, teapot) starting from where my camera is, and in the direction my mouse is pointing. Y axis is up/down , Z is front/back and X is left/right.
for now i'm not worried about the up/down Y axis, and heres what i do now, i get the current mouseAngle, store it. I set a velocity to 10 for my projectile. Then go in and set my projectile through each iteration of the gameLoop like this
velocity = velocity - .8;
x = x + ( velocity * cos(mouseAngleY) );
z = z + ( velocity * sin(mouseAngleY) );
projectilePosition( x , y , z)
so right now it goes off at a constant speed and never stops once i hit fire. Not only that but the mouseAngle only works if i'm looking in a specific quadrant and even then i dunno what its doing. All i wanna do is set up a basic shooter and if I can't chuck projectiles where i'm aiming then i'm kinda boned. Any ideas guys? Forums been super helpful sofar so i'm crossin my fingers.
hey doods