How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask Mr. Gregory White Your Own Question
Mr. Gregory White
Mr. Gregory White, Professor
Category: Homework
Satisfied Customers: 5240
Experience:  M.A., M.S. Education / Educational Administration
46856550
Type Your Homework Question Here...
Mr. Gregory White is online now
A new question is answered every 9 seconds

The second project builds on the first project by adding the

Customer Question

The second project builds on the first project by adding the ability to specify transformations of some of the graphic objects. The specification for those objects now will require less information about their position and size because both will be able
to be modified using the transformations. As before, you must complete the skeleton project provided by defining some of the remaining classes. The UML diagram for the whole project is shown below: Project 2 UML The code for all the classes shown in black
is provided in the attached .zip file. You must complete the project by writing those classes shown in red. The skeleton project contains a parser that will parse a scene definition file that defines the scene to be displayed. The new grammar for the scene
definition file is shown below: scene -> SCENE IDENTIFIER number_list graphics END '.' graphics -> graphic graphics | graphic graphic -> text | transformable_graphic transformations END transformable_graphic -> isosceles | parallelogram | regular_polygon isosceles
-> ISOSCELES COLOR number_list ANGLE NUMBER ';' parallelogram -> PARALLELOGRAM COLOR number_list ANGLE NUMBER ';' regular_polygon -> REGULAR_POLYGON COLOR number_list SIDES NUMBER RADIUS NUMBER ';' text -> TEXT COLOR number_list AT number_list STRING ';' transformations
-> transformation transformations | transformation transformation -> rotation | scaling | translation rotation -> ROTATE ANGLE NUMBER ';' scaling -> SCALE number_list ';' translation -> TRANSLATE number_list ';' number_list -> '(' numbers ')' numbers -> NUMBER
| NUMBER ',' numbers Below is a description of the modifications required to each of the five classes from the first project: The Text class is unchanged from the first project. The ConvexPolygon class must now have an additional data element, which is a vector
of pointers to Transformations. The constructor must now be passed this vector in addition to what was previously required. The draw function must now perform each of the transformations before drawing the object. The constructor for the IsoscelesTriangle
class will now require the list of transformation and the color, but the only information specifying the shape will the angle of the top vertex. The base of the triangle should be centered at the origin and the height of the triangle should be 1. It should
perform the transformations using the built in functions of OpenGL, glTranslated, glRotated, and glScaled for translating, rotating and scaling respectively. The constructor for the Parallelogram class will now require the list of transformation and the color,
but the only information specifying the shape will be the angle of the lower left vertex. The lower left vertex should be placed at the origin, the top and bottom sides should be parallel to the x-axis and all sizes should have a length of 1. It should perform
the transformations using the built in matrix multiplication function of OpenGL, glMultMatrixd. The constructor of the RegularPolygon class will now require the list of transformation and the color, but the only information specifying the shape will be the
number of sides. The center of the polygon should be placed at the origin and the radius should be 1. It should perform the transformations using the built in functions of OpenGL, glTranslated, glRotated, and glScaled for translating, rotating and scaling
respectively. In addition to modifying the above classes, you must write the following new classes: The Rotation class must have a member variable containing the angle of rotation, which is passed to and saved by the constructor, so that it can be used to
call the rotate method defined in the Transformable interface, when the transform method that it is required to implement, is called. The Translation class must have member variables containing the x and y distances of translation, which are passed to and
saved by the constructor, so that they can be used to call the translate method defined in the Transformable interface, when the transform method that it is required to implement, is called. The Scaling class must have member variables containing the x and
y scale factors, which are passed to and saved by the constructor, so that they can be used to call the scale method defined in the Transformable interface, when the transform method that it is required to implement, is called. Sample Input and Output Below
is a sample of a scene definition file that would provide input to the program: Scene Polygons (500, 500) Isosceles Color (0.0, 0.0, 1.0) Angle 90; Rotate Angle 45; Translate (100.0, 0.0); Scale (50.0, 50.0); End RegularPolygon Color (1.0, 0.0, 0.0) Sides
7; Translate (-100.0, 0.0); Scale (75.0, 75.0); End Parallelogram Color (0.0, 1.0, 0.0) Angle 45; Rotate Angle 45; Translate (100.0, -100.0); Scale (90.0, 90.0); End Text Color(0.0, 0.0, 0.0) at (-200., 200.)
Submitted: 1 year ago.
Category: Homework
Customer: replied 1 year ago.
Posted by JustAnswer at customer's request) Hello. I would like to request the following Expert Service(s) from you: Software Development. Let me know if you need more information, or send me the service offer(s) so we can proceed.
Expert:  Mr. Gregory White replied 1 year ago.
THIS ANSWER IS LOCKED!

You need to spend $3 to view this post. Add Funds to your account and buy credits.

Related Homework Questions