I am trying to draw reflection of raycast, and it drives me mad.
I could successfully draw line between origin and destination (the ray cast), I also got normal, which is said to be:
say the origin is O and intersection of ray and another body is I, what is the formula for reflection R?
I searched and tried:
V = (O - I) // the incoming ray vector
R = V + 2(N.V)N
where . means dot product.
but the result looks like the reflection is in the same direction as incoming ray.
Could anyone give me any suggestions? Is there any angle/degree conversion I missed?
Thanks
I could successfully draw line between origin and destination (the ray cast), I also got normal, which is said to be:
Quote:
the normal vector at the point of intersection
say the origin is O and intersection of ray and another body is I, what is the formula for reflection R?
I searched and tried:
V = (O - I) // the incoming ray vector
R = V + 2(N.V)N
where . means dot product.
but the result looks like the reflection is in the same direction as incoming ray.
Could anyone give me any suggestions? Is there any angle/degree conversion I missed?
Thanks
