diff options
author | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-10-23 19:50:49 +0000 |
---|---|---|
committer | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-10-23 19:50:49 +0000 |
commit | 75cc652c577ff70e20c9eeb967c46107d4ff1f35 (patch) | |
tree | d8de1c240222388ca6cf047b9126c329ffe8584f | |
parent | ddba8388c2d3ed199d401a6b29a0c3f7a7fc9806 (diff) |
Tweak lighting
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@171 bf6ca9ba-c028-0410-8290-897cf20841d1
-rw-r--r-- | src/displaywindow.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/displaywindow.c b/src/displaywindow.c index a6810d4..43d6eaf 100644 --- a/src/displaywindow.c +++ b/src/displaywindow.c @@ -386,6 +386,16 @@ static void displaywindow_gl_prepare(DisplayWindow *dw) { dw->gl_list_id = glGenLists(1); glNewList(dw->gl_list_id, GL_COMPILE); + #if 0 + GLUquadric *quad; + quad = gluNewQuadric(); + glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, yellow); + glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, black); + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, yellow); + glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 10.0); + gluSphere(quad, 10, 32, 32); + #endif + /* Bounding cube: 100 nm^-1 side length */ if ( dw->cube ) { glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, black); @@ -635,7 +645,7 @@ static gint displaywindow_gl_expose(GtkWidget *widget, GdkEventExpose *event, Di GLfloat blue_spec[] = { 0.0, 0.0, 1.0, 1.0 }; GLfloat gold[] = { 0.5, 0.5, 0.0, 1.0 }; GLfloat gold_spec[] = { 0.9, 0.9, 0.0, 1.0 }; - GLfloat light0_position[] = { 50.0, 50.0, 50.0, 0.0 }; + GLfloat light0_position[] = { 100.0, 100.0, 100.0, 0.0 }; GLfloat light0_diffuse[] = { 0.8, 0.8, 0.8, 1.0 }; GLfloat light0_specular[] = { 0.8, 0.8, 0.8, 1.0 }; GLfloat bg_top[] = { 0.0, 0.2, 0.0, 1.0 }; @@ -683,8 +693,6 @@ static gint displaywindow_gl_expose(GtkWidget *widget, GdkEventExpose *event, Di glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - glTranslatef(0.0, 0.0, -400.0); - glTranslatef(dw->x_pos, -dw->y_pos, 400.0-dw->distance); /* Set up lighting */ glEnable(GL_LIGHT0); @@ -694,6 +702,8 @@ static gint displaywindow_gl_expose(GtkWidget *widget, GdkEventExpose *event, Di /* The z component of this makes no difference if the projection is orthographic, * but controls zoom when perspective is used */ + glTranslatef(0.0, 0.0, -400.0); + glTranslatef(dw->x_pos, -dw->y_pos, 400.0-dw->distance); build_rotmatrix(m, dw->view_quat); glMultMatrixf(&m[0][0]); |