Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions