ploting a curve
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?)
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.
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
[EDIT]
this is a 2d project
with my calculator i can get the effect i want with
#(AX/\-1)
/\ = to the power of
# = square root
#(AX/\-1)
/\ = to the power of
# = square root
well if thats what you want, theres a sqrt() function inside math.h or cmath. just do
sqrt( ((A*X)*(A*X)) - 1)
sqrt( ((A*X)*(A*X)) - 1)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement