[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bgsdev::open3d

Title:open3d
Notice:Kits on notes 3 and 4; Documents note 223
Moderator:WRKSYS::COULTER
Created:Wed Dec 09 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1306
Total number of notes:5260

1233.0. "glColor and glRasterPos" by RDGENG::READINGS_R (Richard Readings) Tue Feb 04 1997 10:10

In the following code fragment the call to glColor() doesn't seem to take
effect until *after* the calls to glutBitmapCharacter, even if I call
glFlush() after glColor...

  glRasterPos2f(x, y);
  glColor3f(red, green, blue);
  len = (int) strlen(string);
  for (i = 0; i < len; i++) {
    glutBitmapCharacter(font, string[i]);
  }

I've tried this on PowerStorm 4D20, 4D40T and ZLXp-L2, under DUNIX V4.0A and
Open3D 4.2, all with the same result. 

If glColor() precedes glRasterPos() all is well.

I'm assured that on SGI glColor() takes effect before the calls to
glutBitmapCharacter.

Any suggestions?

Richard
T.RTitleUserPersonal
Name
DateLines
1233.1RasterPos sets the color for bitmap text, not ColorVESPER::VESPEROpenGL Alpha GeekTue Feb 04 1997 12:5427
>In the following code fragment the call to glColor() doesn't seem to take
>effect until *after* the calls to glutBitmapCharacter, even if I call
>glFlush() after glColor...
>  glRasterPos2f(x, y);
>  glColor3f(red, green, blue);

You've been bitten by the 'raster position color' obscurity.

Bitmap text is *not* drawn in the current color, which is the color
set by the Color commands.

Instead, bitmap text is drawn in the *raster position color*, which is
computed and saved at the time you call RasterPos. If you have lighting
enabled, the raster position is lighted as if it were a point (i.e., using
the position, normal, material properties and all the lights currently
enabled) and the computed color is stored as the raster position color. 
If you have lighting disabled, the current color is stored as the
raster position color.

So, you do need to do:

	glColor3f
	glRasterPos2f

to get the desired color for text.

Andy V