Using OpenGL environment you are asked to create an airplane and move it around the screen.
Step 1: Define the shape of a 2D aircraft. You can draw a simple aircraft model as any sort of polygon.
Step 2: Make sure you can draw the airplane by calling a drawing function
Void draw_airplane(int xpos, int ypos, angle, warpfactor)
This function will draw the airplane at a position P= (xpos, ypos). The angle and warfpfactor will be explained in Step3 and Step 5 respectively. Make sure that the airplane does not crash when the airplane is close the screen border.
Step 3: The rotation angle is defined by the angle . The rotation angle initially starts with a value of 0, which should make the direction of the airplane to the right of the screen. Use left and right arrow keys on the keyboard to rotate the airplane into left and right directions respectively.
Step 4: Each time the main loop of the program is executed, the airplane will have a position P and a velocity V. Velocity of an object is defined by its speed and direction. Each time through the loop, the new position is obtained by adding the velocity vector to the position vector to get a new position for the airplane.
When the airplane gets near the edge of the screen it is moved to the opposite edge of the screen so that it goes off one edge onto another.
Step 5 (Optional, 20 points bonus). Choose a new key to control the velocity. When the key is hit, add a unit vector to the current velocity vector (in the same direction) that is
Assume that the airplane has a flexible hull, and when then thrusters is turned on, the airplane compresses in the direction with the angle . Make a variable C that defines the degree of compression of the airplane and make C larger when thrusting is used. Let C slowly return to its default value (no compression) when thrusting is not being used. In the draw airplane function, C should be passed in as the warp factor, and it should cause a scaling of the ship in the direction it is facing when the thrust is applied.