ploting a curve

Started by
4 comments, last by raptorstrike 19 years, 7 months ago
ok i have a point of impact I i have a speed S how do i use this information to make the object that is impacting reflect in an ark off that object? (whats the math involved here?)
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie
Advertisement
Trying as hard as I can to not be snarky...

Assuming you want the absolutely most simple collisions, you also need to know something about the object that is being hit. Generally, you just reverse the speed portion that is perpendicular to the face of the object that is hit.

If a ball going 1,1 hits a surface that is vertical, it will then be going -1,1 [as the x axis is perpendicular to the vertical surface]

And know that makes -MANY- assumptions and will pretty much only apply for pong or breakout style games.
yeah i know that and that work great but now im going for acctually curving the ball path (you know like when you put spin on a ping pong ball).
[EDIT]
this is a 2d project
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie
with my calculator i can get the effect i want with

#(AX/\-1)
/\ = to the power of
# = square root
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie
well if thats what you want, theres a sqrt() function inside math.h or cmath. just do

sqrt( ((A*X)*(A*X)) - 1)
FTA, my 2D futuristic action MMORPG
cool i was wondering how i could do sqr roots thanks
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie

This topic is closed to new replies.

Advertisement