Results 1 to 4 of 4

Thread: Colours

  1. #1
    Member 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,753

    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
    Member Contributor
    Join Date
    Jan 2001
    Location
    Canada
    Posts
    86

    Re: Colours

    thx. Didnt know to divide by 255...

  4. #4
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Nov 2010
    Posts
    2,466

    Re: Colours

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

Similar Threads

  1. Blending Two Colours
    By fungus1487 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-15-2012, 04:00 PM
  2. Colours in GLSL
    By persky in forum OpenGL: GLSL
    Replies: 2
    Last Post: 02-22-2012, 09:19 AM
  3. 32bit colours=fast! 16bit colours=very slow??
    By Useless in forum OpenGL: Advanced Coding
    Replies: 14
    Last Post: 09-25-2004, 05:25 AM
  4. Odd colours
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-03-2004, 05:01 AM
  5. Colours
    By link19 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-30-2001, 01:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean