Help to Mirror a vector

Hello all !

I am struggling with a rather simple patch: I am trying to model the reflection of a ray of sun on a mirror ( I guess a 3d planar symmetry on the Normal of the mirror ? ).

I haven t used transforms for years and my brain seem to just snap on this, any help would be greatly appreciated !

Mirror_ray.v4p (40.6 KB)

hey Joanie,
the formula for reflecting a vector on a surface with normal vector n is:

reflection = vec - (2 * dot(vec, n) * n)

where n is normalized.

here is a patch implementing it:

Mirror_ray_formula.v4p (34.7 KB)


Thank you sooooo muuuuuccccchhhh <3 !!
I was starting to look into the formula and patching, but your implementation saved me a lot of headache :) Thanks !! Will keep you posted on the outcome, trying to make a solar projector !