Help @ C++

Discussion in 'C++' started by TuPLaD, Jul 12, 2004.

  1. TuPLaD

    TuPLaD Guest

    Hi, i just started learning how to code OpenGL with the syntax of C++.
    But i got the following problem(YES IT IS C++ BUT ITS A OPENGL
    PROGRAM):

    First of all you need a bool, let's call it bBallDrawn. In
    glPushMatrix set it to true and if it is true in glPopMatrix, we'll
    draw the Ballhack and set it back to false.
    Here's the code:

    glPushMatrix();
    glDisable(GL_TEXTURE_2D); // Ballhack has no textures
    glDisable(GL_DEPTH_TEST); // Makes the Balls visible through walls
    GLUquadricObj *ball;
    if(bT)
    glColor3f(1.0f,0.0f,0.0f); // Set Ballhack Color
    else if(bCt)
    glColor3f(0.0f,0.0f,1.0f); // Set Ballhack Color
    glTranslatef(x,y,z); // insert coordinates here
    ball=gluNewQuadric();
    gluQuadricNormals(ball, GLU_SMOOTH);
    gluSphere(ball,5.0f,32,32);
    gluDeleteQuadric(ball);
    glEnable(GL_DEPTH_TEST);
    glEnable(GL_TEXTURE_2D);
    glPopMatrix();
     
    TuPLaD, Jul 12, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?dHJlbGxvdzQyMg==?=

    HELP! HELP! HELP! Opening Web Application Project Error

    =?Utf-8?B?dHJlbGxvdzQyMg==?=, Feb 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    792
    =?Utf-8?B?dHJlbGxvdzQyMg==?=
    Feb 20, 2004
  2. Harvey
    Replies:
    0
    Views:
    750
    Harvey
    Jul 16, 2004
  3. Harvey
    Replies:
    1
    Views:
    880
    Daniel
    Jul 16, 2004
  4. =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?=

    HELP - HELP - HELP

    =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?=, Mar 9, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    703
    Eliyahu Goldin
    Mar 9, 2006
  5. Buster

    Help, Help, Help

    Buster, Oct 4, 2003, in forum: Java
    Replies:
    3
    Views:
    484
    Saager
    Oct 30, 2003
Loading...

Share This Page