Advertisement

RGB -> OpenGL-Color format?

Started by April 27, 2002 07:00 AM
2 comments, last by Austrian Coder 22 years, 10 months ago
Hi. Can anyone tell me, how i can transform RGB (e.g: 255, 255,255) to OGL-Color (e.g: gfColor3f (1.0, 1.0, 1.0); )? thanks, Austrian Coder
try:
unsigned char r,g,b; // unsigned 8 bit for each color component

glColor3f( (float)r/255.0, (float)g/255.0, (float)b/255.0 );

ps: Couldn''t you use glColor3d ?
Advertisement
Thanks...
glColor3d - in my book i found nothing about this.


Austrian Coder
Try glColor3ub()

This topic is closed to new replies.

Advertisement