reflection geometry finally correct
[laserbrain_demo] / src / renderer.cc
index deff1b9..b9e5884 100644 (file)
@@ -166,7 +166,7 @@ void Renderer::draw_mirror(FlatMirror *mir) const
        // TODO update mirror plane for movable mirrors?
 
        Mat4 mirmat;
        // TODO update mirror plane for movable mirrors?
 
        Mat4 mirmat;
-       mirmat.mirror(mir->wplane.normal, dot(mir->wplane.normal, mir->wplane.pt));
+       mirmat.mirror(mir->wplane.normal, -dot(mir->wplane.normal, mir->wplane.pt));
        glMultMatrixf(mirmat[0]);
 
        glFrontFace(GL_CW);
        glMultMatrixf(mirmat[0]);
 
        glFrontFace(GL_CW);