I have been working on a 3D football game and I am trying to get used to adding the textures that I have been given. The background and the football that I have added are alright and they are showing background and football
but when I try to draw the targets I am having problems when I change the code to which I included in the function
// Called to draw scene
void RenderScene(void)
//red targets
glPushMatrix();
glScalef(0.4, 0.4, 0.4);
glTranslatef(-250.0, 0.0, -968.0);
if (target1) {
drawTexturedQuad(REDTARGET);
}
else
drawTexturedQuad(GREYTARGET);
glPopMatrix();
glPushMatrix();
glScalef(0.4, 0.4, 0.4);
glTranslatef(-575.0, 400.0, -968.0);
if (target2) {
drawTexturedQuad(REDTARGET);
}
else
drawTexturedQuad(GREYTARGET);
glPopMatrix();
glPushMatrix();
glScalef(0.4, 0.4, 0.4);
glTranslatef(500.0, 250.0, -968.0);
if (target3) {
drawTexturedQuad(REDTARGET);
}
else
drawTexturedQuad(GREYTARGET);
glPopMatrix();
//blue targets
glPushMatrix();
glScalef(0.5, 0.5, 0.5);
glTranslatef(-300.0, 250.0, -775.0);
if (target4) {
drawTexturedQuad(BLUETARGET);
}
else {
drawTexturedQuad(GREYTARGET);
}
glPopMatrix();
glPushMatrix();
glScalef(0.5, 0.5, 0.5);
glTranslatef(200.0, 100.0, -775.0);
if (target5) {
drawTexturedQuad(BLUETARGET);
}
else {
drawTexturedQuad(GREYTARGET);
}
glPopMatrix();
//green targets
glPushMatrix();
glScalef(0.8, 0.8, 0.8);
glTranslatef(0.0, 100.0, -488.0);
if (target6) {
drawTexturedQuad(GREENTARGET);
}
else {
drawTexturedQuad(GREYTARGET);
}
glPopMatrix();
glPushMatrix();
glScalef(0.8, 0.8, 0.8);
glTranslatef(100.0, 130.0, -488.0);
if (target7) {
drawTexturedQuad(GREENTARGET);
}
else {
drawTexturedQuad(GREYTARGET);
}
glPushMatrix();
glScalef(0.8, 0.8, 0.8);
glTranslatef(-100.0, 70.0, -488.0);
if (target8) {
drawTexturedQuad(GREENTARGET);
}
else {
drawTexturedQuad(GREYTARGET);
}
glPopMatrix();
when I add this it looks like this enter image description here
I don't know how I could resolve this or what I have done to make it look like this so I have to remove it in the meantime.
This is an example of what I want to see having the targets there enter image description here
Aucun commentaire:
Enregistrer un commentaire