Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Colours

  1. #1
    Intern Contributor
    Join Date
    Jan 2001
    Location
    Canada
    Posts
    86

    Colours

    Hey,
    Im using glColor3d with RGB values in decimal (i.e. from 0->255). I dont get complaints, but not all my colours show up. It seems only the 0 and 255 are recognized as parameters...otherzise the colour shows up white. Whats the deal?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,755

    Re: Colours

    If you're using glColor3d, you should be using values between 0 and 1. Values get clamped to this range so depending on what exactly you send, you probably won't get what you expect. If your colors are in the range 0-255 you should divide them by 255 to get the correct values for glColor3d.
    Deiussum
    Software Engineer and OpenGL enthusiast

  3. #3
    Intern Contributor
    Join Date
    Jan 2001
    Location
    Canada
    Posts
    86

    Re: Colours

    thx. Didnt know to divide by 255...

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,407

    Re: Colours

    d stands for double 1.0 - 1.0
    if u wanna use values between 0-255 use ub (unsigned byte)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •