T
TuPLaD
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();
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();