How do I calculate the reflection vector to this problem? Using the formula r = v - 2 (v.n)n I can get the reflection when the object is sat on the x or y axis however when using this formula when it isnt seems to give strange results. Any help would be greatly appreciated.
The normal vector n
needs to be normalized.
In your example, n
should be (1/sqrt(2), 1/sqrt(2))
.