Answered step by step
Verified Expert Solution
Question
1 Approved Answer
using dev c++ please Open and execute the program lab07_2.cpp Create a snowman using 3D objects. lab07_2.cpp code: #include using namespace std; void init(void) {
using dev c++ please
Open and execute the program lab07_2.cpp Create a snowman using 3D objects.
lab07_2.cpp code:
#includeusing 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started