Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

CompiledMonkey

Basic math help needed...

This topic is 5468 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m making a game for my final project in programming, and I need a little help with curved lines. I''m making 3 Card Monty (http://www.isy.vcu.edu/~cstewart/info350/FinalProject.html) and need a way to move two of the cards around at the same time. I know how to actually do the code of animating the cards, but I don''t know how to come up with the equation to do it with an arc. Can anybody help me here?

Share this post


Link to post
Share on other sites
Advertisement
One way to do it would be by using projectil-like parametric equations. In other words, set an x velocity, and update that until it gets to the destination. Also set a y velocity, but also a y acceleration, updating the velocity with the acceleration (negative if you want an arc that goes up and returns down, positive if you want an arc that goes down then returns up). Note that whatever sign the y acceleration has, the initial y velocity should have the opposite sign.

Check out an introductor physics book for more detail on this simple method of doing things.

Share this post


Link to post
Share on other sites
center of arc = (x,y)
rotation = t (for theta)
radius = r

position of point on arc with given rotation = (cos(t)*r+x,sin(t)*r+y)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!