Question: Using OpenFrameworks and C + + in Visual Studio: 1 ) Create a TriangleShape as a subclass of Shape. This shape should have a position,
Using OpenFrameworks and C in Visual Studio:
Create a TriangleShape as a subclass of Shape. This shape should have a position, rotation and scale parameters. The triangle shape when drawn should use a matrix transformation that uses these properties.
Create a "heading vector" and draw it The heading vector indicates the direction of travel of the triangle. The vector should start at the position of the triangle near it's center and go through the top corner of the traingle in an isosceles triangle, the vector would be drawn through the corner with smallest angle The vector should be X the height of the triangle.
Support the functionality of "dragging" the triangle with the mouse. Only valid mouse down events inside the triangle should initiate dragging.
Now support rotating the triangle using the LEFT and RIGHT arrow keys. The triangle should rotate in place around it's position roughly the center The heading vector should rotate with it
Now support moving the triangle forwards and backwards ALONG the heading vector. hint rt o dt Use the UPDOWN arrow keys for this.
Create your own PNG sprite image. It should have a transparent image and be noncircular so that you can easily tell if it is rotate.
Create a new Shape called "ImageShape" derived from Shape which displayes an image instead of a traingle. The image should rotate around it's center.
Support all the above functionality with the new ImageShape. heading vector and movement Note that for the purposes of selection with the mouse, you can use a bounding rectangle of the image for this assignment.
Create a simple GUI panel with the following controls:
turn heading vector onoff toggle
toggle between image shape or triangle shape
a float slider to control the scale of the triangle or image
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
