Question: #include #include void drow ( ) { glClear ( GL _ COLOR _ BUFFER _ BIT ) ; glPushMatrix ( ) ; glColor 3 f

#include
#include
void drow(){
glClear(GL_COLOR_BUFFER_BIT);
glPushMatrix();
glColor3f(1,0,0);
glScaled(1,2,1);
glutSolidSphere(50,30,30);
glPopMatrix();
glPushMatrix();
glColor3f(0,1,0);
glTranslated(0,20,0);
glRotated(90,1,0,0);
glutSolidTorus(10,60,10,10);
glPopMatrix();
glPushMatrix();
glLineWidth(5.0);
glBegin(GL_LINES);
glVertex3d(50,70,0);
glVertex3d(110,140,0);
glEnd();
glPopMatrix();
glFlush();
glBegin(GL_LINES);
glVertex3d(5,100,0);
glVertex3d(5,145,0);
glEnd();
glPopMatrix();
glFlush();
glBegin(GL_LINES);
glVertex3d(-40,70,0);
glVertex3d(-100,140,0);
glEnd();
glPopMatrix();
glFlush();
}
int main(){
glutInitWindowSize(400,400);
glutCreateWindow("PROJECT");
glutDisplayFunc(drow);
glOrtho(150,-150,150,-150,150,-150);
glClearColor(1,1,1,1);
glutMainLoop();
}
i want to modify and add to the existing code, or a new, complete, correct code, to draw the shape in the image
#include #include void drow ( ) { glClear ( GL _

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!