Assignment 1 : A 2D Game Engine Due: Fri Sep 1, 2017, 23:59:59 Late penalty: Penalties are off the maximum mark. 1.5 marks/day and 1 mark/day for the bonus game Marks: 15 Marks plus up to 3 Bonus Marks Note on bonus marks policy: bonus marks do not carry across to make up for final exam marks. They can only count towards the 40% allocated to assignment marks. Intro For the first assignment you will be building a simple 2D game engine. This is an individual assignment The aim of this assignment is to test: 1. Your understanding of the idea of a scene graph. 2. Your understanding of 2D affine transforms (translation, rotation, scale) 3. Your ability to set the modelview transform in OpenGL 4. Your ability to use the orthogonal projection. 5. Your ability to draw simple shapes. 6. Your ability to model a simple scene using the scene graph Task You task is to complete the implementation of a scenegraph based game engine and use it to make a simple game (or animation). The engine is designed to allow a games programmer to implement simple 2D objects, connect them in a scenegraph (in this case, a tree) and animate them in response to user input. Files Download a set of base classes here. These classes implement the basic datastructures, but are incomplete. The files provided are: 1. GameEngine the GLEventListener which handles init(), dispose(), update() and display() methods, mostly by passing them off to other components. You should read and understand this class but you should not need to modify it unless you do the bonus collision testing part. 2. GameObject an object in the scenegraph. This class represents a node in the tree structure, with its own local coordinate frame. You will need to complete code to calculate the global position of this node, and to compute the model transform for its coordinate frame. 3. PolygonalGameObject an extension of GameObject that represents a convex polygon. You will need to complete code to draw the polygon in the local coordinate frame. 4. Camera an extension of GameObject that represents the camera. You will need to complete code to compute the view transform for the camera’s position and orientation. 5. MathUtil a small library of math functions that you may find useful, including matrix multiplication. You will need to complete methods to construct matrices for translation, rotation and scaling. http://www.cse.unsw.edu.au/~cs3421/17s2/assignments/ass1-base.zip 6. Mouse a singleton class that keeps track of mouse button presses and mouse movement in world coordinates. You should not need to modify this class. We will be using automarking to test some of these classes, so you need to make sure you do not change class names or method signatures. You may add additional classes and methods as you wish. Detail All the methods and classes you need to implement have been marked with the TODO tag. They are described in detail below MathUtil public static double[][] translationMatrix(double[] v) public static double[][] rotationMatrix(double angle) public static double[][] scaleMatrix(double scale) These three methods should return 3×3 arrays of doubles representating a 2D translation, rotation and scale matrix respectively, to apply to a vector in homogeneous coordinations. The matrices should be specified in (row, column) order. So m[2][1] refers to the entry in row 2, col 1. We have provided a class called MathUtilTest.java. This is a junit test class that you can use as a