Starting from:

$29.99

Object Matrix Transformation_Project 2

Object Matrix Transformation

 

For your second project will be creating a Vector Object class that uses the Matrix3x3f class provided in the text. You will then need to create an application with three VectorObjects that behave as detailed below.

 

Requirements

 

VectorObject Class

Define a class called VectorObject that implements the Drawable interface as shown in the slides. The class must store a collection of Vector2fs as defined in the text. These points define the vector object about the origin and should not be altered. It will also contain a Matrix3x3f for the object’s World Matrix. Finally, values for its location, scale, rotation, and color.

 

You will need to implement the methods from the Drawable interface, as well as set and get methods you deem appropriate.

 

Application

The application must be windowed with a resolution of 1280x720. The window should have the title of “Matrix Transformation”. Your application must create three separate VectorObjects, each behaving differently, each must be a different color (of your choice).

 

Automatic Object

One object is a square that moves around the screen automatically. It must start in the center of the screen. It will move diagonally until it hits the edge of the window, then bounce off, starting to move in the opposite direction (think the bouncing Window screen saver). Make sure no part of the object goes off screen, and should not ricochet early (before a side of the square hits the boundary).

 

Keyboard Controlled Object

One object is a hexagon that is controlled via the keyboard. It must start in the center of the screen. The object will move around the window with WASD controls. It must also check for window bounds, not allowing any part of the object to move out of the window, but being allowed to touch the window bounds. This object will also automatically rotate, initially clockwise. The Q and E keys will decrease and increase the amount of rotation per game loop (respectively). Pressing SPACE will reverse the current direction of rotation.

 


Mouse Controlled Object

One object is a triangle controlled via the mouse. This will work like a cursor, its position being that of the mouse. Be sure to disable the normal cursor. Additionally, this object will rotate counter-clockwise while the left mouse button is pressed, and clockwise while the right mouse button is pressed.

 

Other Notes

You are not given exact dimensions of the objects or the amount of rotation or change in rotation. This is so you play around with the values to get a feel for them. However, the result must be reasonable. For example, don’t make the change in rotation so fast that it is sped up too fast and the process cannot be easily observed. Make objects large enough to easily see them, and small enough such that there is enough space for them to move around the window.

 

For defining the points of your objects this website is very helpful:

http://www.mathopenref.com/coordpolycalc.html

 

You can give it the number of sides and radius of the object you want, and it will give you the points that make up that object. Just be sure to set the center to the origin.

 

Be thoughtful in your design of the VectorObject class. You will be returning to it later.

 

Grading Rubric

Your submission will be graded on the following points for the given values:

 

Class Design Document – 2 points

ObjectVector Class – 10 points

Automatic Object – 8 points

Keyboard Object – 8 points

Mouse Object – 8 points

Other Requirements – 4 points

More products