Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please how can I do the following : translation, rotation , scaling . this is my C++ code to output a drawing of rocket... I

please how can I do the following : translation, rotation , scaling . this is my C++ code to output a drawing of rocket... I use OPENGL on visual studio... #include #include void rocket() { glClearColor(0.196078, 0.6, 0.8, 1.0); glClear(GL_COLOR_BUFFER_BIT ); glColor3f(0.647059, 0.164706, 0.164706); glColor3f(1, 1, 1); glBegin(GL_POLYGON);//core glVertex2f(237.5, 20.0); glVertex2f(262.5, 20.0); glVertex2f(262.5, 120.0); glVertex2f(237.5, 120.0); glEnd(); glColor3f(0, 0, 1);//head glBegin(GL_POLYGON); glVertex2f(237.5, 120.0); glVertex2f(262.5, 120.0); glVertex2f(250, 170.0); glEnd(); glColor3f(1.0, 0.0, 0.0); glBegin(GL_POLYGON);//left glVertex2f(237.5, 120.0); glVertex2f(217.5, 95.0); glVertex2f(237.5, 95.0); glEnd(); glBegin(GL_POLYGON);//left glVertex2f(237.5, 20.0); glVertex2f(217.5, 20.0); glVertex2f(237.5, 70.0); glEnd(); glBegin(GL_POLYGON);//right bot glVertex2f(262.5, 20.0); glVertex2f(282.5, 20.0); glVertex2f(262.5, 70.0); glEnd(); glBegin(GL_POLYGON);//right top glVertex2f(262.5, 120.0); glVertex2f(262.5, 95.0); glVertex2f(282.5, 95.0); glEnd(); glFlush(); } void myinit() { glClearColor(0.196078, 0.6, 0.8, 1.0); gluOrtho2D(0.0, 499.0, 0.0, 499.0); } int main(int argc, char* argv[]) { glutInit(&argc, argv); glutInitWindowSize(500, 500); glutCreateWindow("rocket ;O!"); glutDisplayFunc(rocket); myinit(); glutMainLoop(); return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Logic In Databases International Workshop Lid 96 San Miniato Italy July 1 2 1996 Proceedings Lncs 1154

Authors: Dino Pedreschi ,Carlo Zaniolo

1st Edition

3540618147, 978-3540618140

Students also viewed these Databases questions

Question

Why? What will be my payoff?

Answered: 1 week ago