mirror of https://github.com/vitalif/openscad
bugfix: Make lighting work the same way as in earlier versions. Bug reported by nop head.
parent
eab74d1fbe
commit
de4d1e4b85
|
@ -358,6 +358,7 @@ void GLView::setupPerspective()
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
glFrustum(-w_h_ratio, +w_h_ratio, -(1/w_h_ratio), +(1/w_h_ratio), +10.0, +FAR_FAR_AWAY);
|
glFrustum(-w_h_ratio, +w_h_ratio, -(1/w_h_ratio), +(1/w_h_ratio), +10.0, +FAR_FAR_AWAY);
|
||||||
|
gluLookAt(0.0, -viewer_distance, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLView::setupOrtho(double distance, bool offset)
|
void GLView::setupOrtho(double distance, bool offset)
|
||||||
|
@ -387,8 +388,6 @@ void GLView::paintGL()
|
||||||
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||||
|
|
||||||
gluLookAt(0.0, -viewer_distance, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0);
|
|
||||||
|
|
||||||
glRotated(object_rot_x, 1.0, 0.0, 0.0);
|
glRotated(object_rot_x, 1.0, 0.0, 0.0);
|
||||||
glRotated(object_rot_y, 0.0, 1.0, 0.0);
|
glRotated(object_rot_y, 0.0, 1.0, 0.0);
|
||||||
glRotated(object_rot_z, 0.0, 0.0, 1.0);
|
glRotated(object_rot_z, 0.0, 0.0, 1.0);
|
||||||
|
|
Loading…
Reference in New Issue