Jump to content
  • Advertisement

TiagoKo

Member
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

100 Neutral

About TiagoKo

  • Rank
    Newbie
  1. 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. 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. 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. Change the acceleration direction to "down"..... it dont make sense. its only make gravity acceleration bigger.
  5. 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. I implemented wind like acceleration X and Y every frame i increment on velocity X and Y.
  7. 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.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!