Results 1 to 4 of 4

Thread: howto generate colors

  1. #1
    Member Newbie
    Join Date
    Apr 2002
    Location
    Berlin
    Posts
    49

    howto generate colors

    Is there a way to let OpenGl gegerate colors similar to the texture coordinate generation ? I want to render a 3d graph where the higher a Vertex is the more should it turn from green to red.
    My only idea would be to use a 3d texture with 2 planes, a red and a green one. This way I could use texgen functionality but this seems to be overkill.

  2. #2
    Member Newbie
    Join Date
    Apr 2002
    Location
    Berlin
    Posts
    49

    Re: howto generate colors

    Well, after thinking about it again the best solution seems to be a 1D texture but is there any way to let opengl generate color values at all ?

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: howto generate colors

    Lighting will generate colors for you.

  4. #4
    Member Newbie
    Join Date
    Jun 2002
    Posts
    33

    Re: howto generate colors

    You can also switch off lighting and just use colour3f to colour vertexs and smooth colours enabled to shade from red to blue. See HeNe tutorials for his pyramid (this has a different colour for each corner).

Similar Threads

  1. Replies: 3
    Last Post: 06-19-2016, 08:11 AM
  2. Replies: 2
    Last Post: 06-15-2015, 03:26 AM
  3. quadstripts and normal - howto
    By OGLguy in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-10-2009, 05:21 PM
  4. Howto generate 3D Vertex Data
    By barracuda12 in forum OpenGL: General
    Replies: 4
    Last Post: 12-13-2006, 06:48 PM
  5. How to generate rainbow colors in OpenGl?
    By Fanghui Chen in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 05-23-2001, 07:37 AM

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