what am i doing wrong. i want to be able to see the two spheres but only one appear can you help a novice please?
#include <windows.h>
#include <gl/glut.h>
void sheep(void) //draw scene
{
glClear(GL_COLOR_BUFFER_BIT);//clear window
glScalef(0.8f,1.0f,1.0f);
glColor3f(1.0f,1.0f,1.0f);
GLUquadricObj *sheepBody;
sheepBody = gluNewQuadric();
gluSphere(sheepBody,30, 30, 30);
glTranslatef(20.0f,30.0f,0.0f);
glScalef(1.0f,0.8f,1.0f);
glColor3f(0.0f,0.0f,0.0f);
GLUquadricObj *sheepHead;
sheepHead = gluNewQuadric();
gluSphere(sheepHead,10, 10, 10);
}
void SetupRC(void) //setup rendering state
{
glClearColor(0.0f,0.0f,1.0f,1.0f);
}
void ChangeSize(GLsizei w, GLsizei h)
{
GLfloat nRange = 100.0f;
//GLfloat fAspect;
if(h==0)
h=1;
glViewport(0,0,w,h);
//fAspect = (GLfloat)w/GLfloat)h;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(0.0f,0.0f,1.0,425.0);
if (w <= h)
glOrtho (-nRange,nRange,-nRange*h/w,nRange*h/w,-nRange,nRange);
else
glOrtho (-nRange*w/h,nRange*w/h,-nRange,nRange,-nRange,nRange);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
void main(void) //program entry point
{
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutCreateWindow(“Sheep”);
glutDisplayFunc(sheep);
glutReshapeFunc(ChangeSize);
SetupRC();
glutMainLoop();
}