diff --git a/SierpinskiDA.cc b/SierpinskiDA.cc index 371ea4d..2275418 100644 --- a/SierpinskiDA.cc +++ b/SierpinskiDA.cc @@ -45,7 +45,7 @@ void SierpinskiDA::regenerate(int npts) glBegin(GL_POINTS); double pt[3]; - double r = rand() / RAND_MAX; + double r = rand() / (double) RAND_MAX; for (int i = 0; i < 3; i++) { pt[i] = pts[0][i] + r * pts[1][i] - pts[0][i]; @@ -89,8 +89,8 @@ bool SierpinskiDA::draw() gluPerspective(60, get_width()/(double)get_height(), 0.01, 1000.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - gluLookAt(0, -3, 1, - 0, 0, 0.7, + gluLookAt(0, -3, 1.5, + 0, 0, 1, 0, 0, 1); glCallList(m_dl); @@ -134,10 +134,13 @@ void SierpinskiDA::on_realize() glViewport(0, 0, get_width(), get_height()); m_dl = glGenLists(1); -// glEnable(GL_LIGHTING); -// glEnable(GL_LIGHT0); -// float color[] = {1, 1, 1, 1}; -// glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, color); + glEnable(GL_DEPTH_TEST); +#if 0 + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + float color[] = {1, 1, 1, 1}; + glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, color); +#endif glColor3f(1, 1, 1); gl_end();