Right, I have come along way since my last post. I now fully understand why no answer was given before when I asked "How do I get the resultant angle of an object bouncing off a wall". Well first of all I asked the wrong question, what I really needed was the vector of reflection.
Second, oh boy, was I not prepared for the complexity of information that was involved lol! Anyway, I have read and re-read many papers on vectors and vector geometry. I am really really close to finally pulling off a proper vector reflection but im stuck!
I know how to add vectors together, I know how to use dot products, I know how to multiply a vector by another vectors magnitude (Just a scalar).
But I dont understand whats going on in this formala for the vector of reflection.
I = Normalised Vector of Incidence (IE, the vector velocity of the ball)
N = The Normalised version of the Perpendicular of the Line that has been collided with
R = The resulting vector of reflection
R = I - 2(I.N)N
Right, now the thing I dont understand the the bit on the end where we multiply (I.N) by N
I can work out the dot product between I.N, but then I dont know how or WHAT method I should use to multiply that value by the N on the end.
Just as an example, I was doing some working on paper to produce a vector which I know what the answer should be.
I = (1, -1)
Vector of the Line collided with = (2,2)
The perpendicular of the line collided with = (-2,2)
The magnitude of the perpendicular = 2.828427125
The normalised version of the perpendicular = (-0.7071067811, 0.7071067811) = N'
The normalised version of the vector of incidence = (0.7071067812, -0.7071067812) = I'
The Dot Product of I.N
(I.N) = (-0.5, 0.5)
Since R = I - 2 (I.N)N
I multiply the vector (I.N) by the two then I get
R = I - (-1,1)N
Ok, but at this point, -1,1 is already the answer!
So how do I finish this? How do I multiply (-1,1)N. If I used the magnitude, which is 1, I get the same answer but the completely wrong answer (I think) after I subtract it from I.
I read several tutorials on this and some seem to have slighty different equations than the one I should shown.
In one tutorial it told me to Normalise "I" before I do the equation R = I - 2(I.N)N
Any advice would be very much welcome.