G
Guest
Guest
I am making a 3d game and want a ball to bounce off corectly any surface that it hits. I want to make a function to do the math for this. As input, I will have the current vector of the ball, and the vector of the surface that it hit. As output, I want to have the resulting vector of the ball.
So, how do you reflect a 3d vector on another 3d vector?
I have writen down a bunch of inputs and outputs, and tried to find a way to get to the output, but couldn't think of anything. I tried to find paterns, and found a bout a million, but there always seemed to be at least one peice of evidence that would prove that patern wrong. I have looked on the internet for an equation that would do this, and found two sites that refrenced the same equation, but I am not sure I understood how to use the equation properly, because it did not work for all of my number sets.
Thanks in advance for any help!
So, how do you reflect a 3d vector on another 3d vector?
I have writen down a bunch of inputs and outputs, and tried to find a way to get to the output, but couldn't think of anything. I tried to find paterns, and found a bout a million, but there always seemed to be at least one peice of evidence that would prove that patern wrong. I have looked on the internet for an equation that would do this, and found two sites that refrenced the same equation, but I am not sure I understood how to use the equation properly, because it did not work for all of my number sets.
Thanks in advance for any help!