Question: use OpenGL dev-c++ , Please modify this code to Create a snowman using 3D objects : #ifdef __APPLE_CC__ #include #else #include #endif //#include using namespace
use OpenGL dev-c++ , Please modify this code to Create a snowman using 3D objects :
#ifdef __APPLE_CC__ #include#else #include #endif //#include using namespace std; void init(void) { glClearColor(0.5, 0.5, 0.5, 0.5); glShadeModel(GL_FLAT); } void drawSnowMan() { //your code should go here } void display(void) { glClear(GL_COLOR_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); drawSnowMan(); glutSwapBuffers(); glutPostRedisplay(); } void reshape(int w, int h) { glViewport(0, 0, (GLsizei)w, (GLsizei)h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-2, 2, -2, 2, 0, -10); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); } int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); glutInitWindowSize(500, 500); glutInitWindowPosition(100, 100); glutCreateWindow(argv[0]); init(); glutDisplayFunc(display); glutReshapeFunc(reshape); glutMainLoop(); return 0; }
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
