Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

okay so basically this is the question remember not to use set up or draw functions. Q 1 : Draw a Helicopter [ 1 2

okay so basically this is the question
remember not to use set up or draw functions.
Q1: Draw a Helicopter [12 Marks]
Draw a helicopter using the shapes that have been taught to you in the class. Figure 1
demonstrates the sample object. To complete Q1 your sketch should meet the following
criteria:
Draw a helicopter similar to, but not the same as, the one shown here.[1]
Use a canvas size of 500 by 500.[1]
Your helicopter must have at least: [1]
o One rectangle, ellipse, line and triangle.
o Make use of at least two additional colors other than black and white.
o Note: Sample drawing and video has not been given any color. Use your
creativity!
The helicopter should have the features as explained in Figure 1.[6]
o Cockpit and Cockpit Windows
o Fuselage
o Blades
o Main Rotor and Engine Cover
o Sync Elevator, Elevator Tail and Elevator Deval
o Tail Boom and Tail fin.
Use final named constants to set the size and position of the shapes that make up the
helicopter. [1]
At all times, your helicopter should be at the center of the canvas, and it should fill the
entire canvas. [2]
Note: This is a static Processing program (no setup or draw functions). i made the helicopter but i think that the code isnt right.
here is my code
background(255);
float centerX = width /2;
float centerY = height /2;
// Helicopter dimensions and colors
final float ELEVATOR_TAIL_WIDTH =55;
final float ELEVATOR_TAIL_HEIGHT =10;
final float ELEVATOR_DECAL =173;
final float TAIL_BOOMX =230;
final int FUSELAGE_X =150;
final int FUSELAGE_DIAMETER =100;
final int COCKPIT_WIDTH =50;
final int ENGINE_COVER =30;
final int WINDOW_HEIGHT =8;
final int MAIN_ROTOR =78;
final int BLADE1X =410;
final int BLADE1Y =200;
final int BLADE2X =255;
final int BLADE2Y =50 ;
final int TAIL_FIN =160;
// DRAW ELEVATOR TAIL ABOVE
fill(200,200,200); // Light gray color
rect(centerX-200, centerY-50, ELEVATOR_TAIL_WIDTH, ELEVATOR_TAIL_HEIGHT);
// DRAW SYN ELEVATOR
fill(150,150,150); // Darker gray color
rect(centerX - ELEVATOR_TAIL_HEIGHT *19, centerY - ELEVATOR_TAIL_HEIGHT *4, ELEVATOR_TAIL_WIDTH -20, ELEVATOR_TAIL_HEIGHT *10);
// DRAW ELEVATOR TAIL BELOW
fill(200,200,200); // Light gray color
rect(centerX-200, centerY +60, ELEVATOR_TAIL_WIDTH, ELEVATOR_TAIL_HEIGHT);
// DRAW ELEVATOR DECAL 1
fill(255,0,0); // Red color
circle(centerX - ELEVATOR_DECAL, centerY -23, ELEVATOR_TAIL_HEIGHT +5);
// DRAW ELEVATOR DECAL 1
circle(centerX - ELEVATOR_DECAL, centerY +45, ELEVATOR_TAIL_HEIGHT +5);
// DRAW TAIL BOOM
fill(100,100,100); // Dark gray color
triangle(centerX - TAIL_BOOMX, centerY + ELEVATOR_TAIL_HEIGHT, centerX, centerY, centerX, centerY +30);
// DRAW FUSELAGE
fill(50,50,150); // Blue color
circle(centerX + FUSELAGE_X, centerY, FUSELAGE_DIAMETER);
// DRAW COCKPIT
fill(0,0,150); // Dark blue color
rect(centerX, centerY - COCKPIT_WIDTH, FUSELAGE_X, FUSELAGE_DIAMETER);
// DRAW COCKPIT WINDOW 1 ABOVE
fill(0,255,255); // Cyan color
rect(centerX + ENGINE_COVER, centerY - COCKPIT_WIDTH, FUSELAGE_DIAMETER, WINDOW_HEIGHT);
// DRAW COCKPIT WINDOW 1 BELOW
rect(centerX + ENGINE_COVER, centerY +43, FUSELAGE_DIAMETER, WINDOW_HEIGHT);
// DRAW ENGINE COVER
fill(50,50,50); // Dark gray color
rect(centerX + ENGINE_COVER, centerY -25, FUSELAGE_DIAMETER, COCKPIT_WIDTH);
// DRAW MAIN ROTOR
fill(#46FFF1); // Black color
circle(centerX + MAIN_ROTOR, centerY, ENGINE_COVER);
// DRAW MAIN ROTOR BLADES
fill(#FF4646); // Dark gray color
triangle(centerX + MAIN_ROTOR, centerY, centerX + MAIN_ROTOR +150, centerY -15, centerX + MAIN_ROTOR +150, centerY +15);
triangle(centerX + MAIN_ROTOR, centerY, centerX + MAIN_ROTOR -150, centerY -15, centerX + MAIN_ROTOR -150, centerY +15);
// DRAW TAIL FIN
fill(100,100,100); // Dark gray color
ellipse(centerX - TAIL_FIN, centerY + ELEVATOR_TAIL_HEIGHT, ENGINE_COVER, ELEVATOR_TAIL_HEIGHT);
now i want my all parts to be relative to the center and i want to make the main rotor as my center, becuz the next question says
Q2: Scalable and movable. [10 Marks]
Modify your program Q1 to meet the following criteria:
Use a canvas size of 500 by 500.[1]
The cursor has to be in the center of your main rotor all the times, even when the
helicopter is moving.[3]
Change constant SCALE to a variable scale for this question. Consider scale in all your
calculations so by changing this variable, the helicopter becomes smaller or bigger.[3]
Requirement is that changing the value of scale changes the scale of the drawing
appropriately.
Use of following functions to help organize your code.[5]
o cockPit();
o elevator();
o tailBoom();
o bladeAndRotor();
o Note: Create your own functions as and when needed. Please explain the
purpose of the functions using comments.
Note: This is an active processing program (with setup and draw). so please write a correct code for the helicoptor. i am attaching the photo of helicoptirr
image text in transcribed

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

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

=+a) What is the standard deviation of the sample mean?

Answered: 1 week ago