From: John Stewart <john.stewart@cr...>  20000629 15:30:34

Hi Brian; I am in real RTFM mode; going through the chapter on lighting in "OpenGL Programming Guide" from the OpenGL Arch.rev.board. > Are you using the GL_REPLACE tex env? I fixed a bug related > to this and vertex color generation a couple weeks ago. No. (IMHO, at least grep says so) It seems to be related to the lighting model selected; I can "break" it, but at least, the results are similar between hw and sw only rendering.. :) Backgrounds are created by a bunch of GL_QUADS to mimic the sky/ground. (see some of the pics on my web page, url below) These quads make a kind of diamond or sphere shape that follows you around; you are in the centre of it. It follows you on the x/y/z axis, but does not follow your rotations. What happens in this code (as I am learning it, and OpenGL at the same time) is: glPushAttrib(GL_LIGHTING_BITGL_ENABLE_BITGL_TEXTURE_BIT); glShadeModel(GL_SMOOTH); glPushMatrix(); glGetDoublev(GL_MODELVIEW_MATRIX, mod); glGetDoublev(GL_PROJECTION_MATRIX, proj); /* Get origin */ gluUnProject(0,0,0,mod,proj,viewport,&x,&y,&z); glTranslatef(x,y,z); gluUnProject(0,0,0,mod,unit,viewport,&x,&y,&z); /* Get scale */ gluProject(x+1,y,z,mod,unit,viewport,&x1,&y1,&z1); sx = 1/sqrt( x1*x1 + y1*y1 + z1*z1*4 ); gluProject(x,y+1,z,mod,unit,viewport,&x1,&y1,&z1); sy = 1/sqrt( x1*x1 + y1*y1 + z1*z1*4 ); gluProject(x,y,z+1,mod,unit,viewport,&x1,&y1,&z1); sz = 1/sqrt( x1*x1 + y1*y1 + z1*z1*4 ); /* Undo the translation and scale effects */ glScalef(sx,sy,sz); /* JAS this has been shown to cause problems with hw accel (voodoo 2/3) glDisable(GL_LIGHTING); */ Make the GL_QUADS here...  John Stewart john.stewart@... http://www.crc.ca/FreeWRL/ If windows is the answer, it must have been a stupid question. 