camera position update

git-svn-id: svn://anubis/misc/sierpinski-gtk@253 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
josh 2010-10-22 04:49:55 +00:00
parent 4ae50b97c8
commit 58ff70113a

View File

@ -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();