Original Post
Im new to opengl programming and i am creating a simple room. The rooms will contain a chair desk and fan(the fan will move). I have created all of the above however when i combine into one scene it flashes on and off. I believe this is due to my fan, as it doesnt happen when the fan is not in the room. The code for my fan is split into three parts: fan base Fan head build fan Is there a way in which i can make the fan spin without having the room flashing??? The code for the fan is as followes: /****************************************************************** desktop fan*/ void deskTopFanBase(void) { glPushMatrix(); //Fan Base glScalef(2.0, 0.5, 2.0); buildBox(); //fan Arm 1 glScalef(0.25, 9.0, 0.25); glTranslatef(0.0, 0.4, 0.0); buildBox(); //Fan Arm 2 glScalef(5.0, 0.15,1.0); glTranslatef(0.3, 3.0, 0.0); buildBox(); //fan head & Joint glScalef(0.25, 1.0, 1.0); glTranslatef(-1.25, 0.0, 0.0); glutSolidSphere(1.0, 20.0, 20.0); glPopMatrix(); } void deskTopFanHead(void) { glPushMatrix(); glutSolidSphere(1.0, 20.0, 20.0); glScalef(2.0, 1.0, 0.1); glTranslatef(0.5, 0.0, 0.0); buildBox(); glTranslatef(-1, 0.0, 0.0); buildBox(); glScalef(0.33, 1.4, 1.0); glTranslatef(1.5, 0.75, 0.0); buildBox(); glTranslatef(0.0, -1.55, 0.0); buildBox(); glPopMatrix(); } /* this part puts all the aspect sof the fan together and makes the fan head spin*/ void buildFan(void) { glPushMatrix(); deskTopFanBase(); glRotatef(90.0, 0.0, 1.0, 0.0); glScalef(0.75, 0.75, 0.75); glTranslatef(0.0, 5.0, 3.2); glRotatef(spin, 0.0, 0.0, 1.0); deskTopFanHead(); glPopMatrix(); glutSwapBuffers(); spin = (spin+ 10)% 360; glutPostRedisplay(); } Thanks for taking the time to read this, i fully appreciate it. kind regards, kelvin