Thread: OpenGL question.

  1. #1

    OpenGL question.

    How can I use variables in this function?

    glVertex3f(-1.0f, 1.0f, 0.0f);

    Would it be something like:
    float red = -1.0;
    float blue = 1.0;
    float green = 0.0;
    glVertex3f(red, blue, green);
    Its just the 'f' on the end of the number that's confusing me.

  2. #2
    Programming is fun, mkay?
    Join Date
    Oct 2001

    Post Yes!

    Yes, you can do that. BTW, The `f' is a hex number I think.


    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  3. #3
    no its not. The f is a float, you can do exactly as you've shown above.

    Try for some great openGL tutorials. is also very good.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OpenGL Question
    By Halo3Master in forum Game Programming
    Replies: 16
    Last Post: 10-02-2007, 02:40 AM
  2. Opengl question
    By Shadowwoelf in forum Windows Programming
    Replies: 3
    Last Post: 06-03-2007, 01:21 PM
  3. OpenGL Camera Question
    By Astra in forum Game Programming
    Replies: 2
    Last Post: 03-25-2007, 01:53 PM
  4. OpenGL Question
    By Shamino in forum C++ Programming
    Replies: 5
    Last Post: 05-05-2005, 02:35 PM
  5. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM