[OpenSCAD] Light source and default camera position different on command line

Marius Kintel marius at kintel.net
Sun Sep 16 09:25:27 EDT 2018

> On Sep 16, 2018, at 8:37 AM, nop head <nop.head at gmail.com> wrote:
> Eureka. I think gluLookAt actually modifies the current matrix. So when  glMatrixMode(GL_MODELVIEW);  glLoadIdentity(); was after it, it actually modifies the projection matrix because that was selected when the projection was set. Moving it after glLoadIdentity() makes it operate on the modelview matrix instead. That is why the view stays the same and the lighting changes.
Looks right.
FYI, there is source code: https://cgit.freedesktop.org/mesa/glu/tree/src/libutil/project.c#n108


More information about the Discuss mailing list