# TiagoKo

Member

7

100 Neutral

• Rank
Newbie
1. ## How to find initial velocity with fixed angle of projectile

Well, it does make sense. Nobody forces you to use coordinates where X is horizontal and Y is vertical. If you are in an environment in which the net acceleration on objects is in some direction other than down, you can work with coordinates in which that direction is in the Y axis, define an X axis that is perpendicular to it, and now you have reduced the problem to the situation with no wind. [/quote] I still dont understand, for example how do you solve with windX = 4, windY = 3, gravity = 10? [/quote] I will assume the sign convention is that positive windY means the wind is blowing down (since it has the same sign as gravity), that the cannon is at the origin and that I am trying to hit the point (targetX, targetY). accelX = 4, accelY = 13 new_X_vector = normalize(13,-4) = (.95577900872195007289, -.29408584883752309935) new_Y_vector = normalize(4,13) = (.29408584883752309935,.95577900872195007289) target_new_X = .95577900872195007289 * targetX + .29408584883752309935 * targetY target_new_Y = -.29408584883752309935 * targetX + .95577900872195007289 * targetY You'll similarly convert the vector in which the cannon is pointing using the same conversion I just did for the target. Then solve the problem in the new coordinates with gravity set to sqrt(13^2+4^2) and no wind. If that's not enough, I'll completely flesh it out, but I don't have the time now. [/quote] Nice, but what i have to change on cannon? I only have his position and aim angle in radian.
2. ## How to find initial velocity with fixed angle of projectile

Well, it does make sense. Nobody forces you to use coordinates where X is horizontal and Y is vertical. If you are in an environment in which the net acceleration on objects is in some direction other than down, you can work with coordinates in which that direction is in the Y axis, define an X axis that is perpendicular to it, and now you have reduced the problem to the situation with no wind. [/quote] I still dont understand, for example how do you solve with windX = 4, windY = 3, gravity = 10?
3. ## How to find initial velocity with fixed angle of projectile

Exactly, the equation that i got is to find speed, and i use cos and sin to get vector from speed. I will try to find any formula that work directly with vectors, i guess it will be easier than work with angles.
4. ## How to find initial velocity with fixed angle of projectile

Change the acceleration direction to "down"..... it dont make sense. its only make gravity acceleration bigger.
5. ## How to find initial velocity with fixed angle of projectile

That just has the same effect as gravity, then. You can just add the two together, define "down" to be the direction in which that vector points and use the same formula you would have used without wind. Let me point out that your wind will probably feel wrong, because that's not at all what wind does to things. A better model would have drag, and the wind is used at the point where you compute the velocity of your object with respect to the air. If the drag is linear, you can still solve the resulting differential equations analytically and get a closed formula. But perhaps you should start thinking about numerical methods that are much more flexible. [/quote] Ok with wind accelaration Y i can sum with gravity acceleration, but about acceleration X i dont know what to do.
6. ## How to find initial velocity with fixed angle of projectile

I implemented wind like acceleration X and Y every frame i increment on velocity X and Y.
7. ## How to find initial velocity with fixed angle of projectile

Hello guys im new here. Im making a game like gunbound or worms, and i need help to make computer hit the target with wind force. My plan is to use a fixed angle, and to find initial velocity to launch the projectile. I found this equation but it works without wind: 'L' = distance X from the target and 'h'=distance Y Anyone know similar equation that works with wind force? Sry my english.