Image

Imagepidgin wrote in Imagecpp

ok... so I have this big physics program due tomorrow, using BSP trees and what not. It is almost working, but something is wrong with my formula for reflecting a line segment over a plane. Can anybody point me to a crystal-clear description of such a procedure?

What I have so far is:
v = (2.0*(dprod(-v, planenormal)))*planenormal + v;
v: normalized incident vector
planenormal: normalized normal of the plane (redundant enough?)
dprod: dot product

I have saved the magnitude of the original incident vector so that it can be re-multiplied in.