Results 1 to 3 of 3

Thread: creting 3d cube with custom vertexes

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2003
    Posts
    1

    creting 3d cube with custom vertexes

    Hi guys... I'm a beginer and need your help.
    I want to draw a 3d cube. The color in each vertexe will be a color depending for a variable that i'm reading from a file. Don't bother about this, just suppose that a want to set each vertex to a random color. How i can do that? I used e nested for loops for x,y and z codrinate and used the glVertex3f(x, y, z) in each (x,y,z) but that produces no result....
    Thanks for any answers...

  2. #2
    Junior Member Newbie
    Join Date
    Jul 2003
    Posts
    23

    Re: creting 3d cube with custom vertexes

    I get to field an easy one!

    try glColor3f(float,float,float)

    I think the order is:
    (red channel, blue channel, green channel)
    your float should be between 0.0f and 1.0f
    glColor3f(0.0f,0.0f,0.0f) will yeild black as the color.
    glColor3f(1.0f,1.0f,1.0f)will be white
    and glColor3f(0.5f,0.5f,0.5f)will yeild a gray. good luck with that

    for more help, visit tutorial two at http://nehe.gamedev.net/

  3. #3
    Senior Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    374

    Re: creting 3d cube with custom vertexes

    Originally posted by GlutterFly:
    I get to field an easy one!

    try glColor3f(float,float,float)

    I think the order is:
    (red channel, blue channel, green channel)
    your float should be between 0.0f and 1.0f
    Just a note that the order is rgb.

Similar Threads

  1. How to get vertexes from OpenGL
    By HMD_Dmitry in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 07-07-2012, 07:05 PM
  2. Zooming Vertexes
    By Veric in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 11-14-2009, 04:47 PM
  3. How to sort vertexes?
    By christus in forum OpenGL: General
    Replies: 4
    Last Post: 03-26-2006, 07:32 AM
  4. Different quad with same vertexes...
    By IG in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-17-2006, 10:40 AM
  5. too many vertexes..
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-15-2001, 02:56 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