18/02/2019 1 Assignment Assignment - Task • Title – Develop from scratch an interactive 3D game • Task – The aim of the assignment is two fold: (a) develop a small game engine in C++ and (b) develop the graphics and physics components for an interactive 3D game • These components should that cover the general motion of a rigid body in three dimensional space, including issues of collision of bodies and their subsequent motion Game Engine - Task • Task – The aim of the game engine component is to implement from scratch a set of computer graphics classes that will be used for • Modelling the scene of the game • creating the physics components of different interactive computer games Game Engine - Specification • Based on the vector theory you should implement a 3D vector class in C++ which will be used as a basis for the rest of the course • Based on the matrices theory you should implement a 3×3 matrix class in C++ which will be used as a basis for the rest of the course • Finally you should implement a ray class in C++ Game Engine - Minimum Implementation • The basic implementation should include the following: – A 3D vector class, which you can call TVector, with three components (x, y and z) – A 3×3 matrix class, which you can call Tmatrix, with a two-dimensional array (i.e. double _Mx[3][3]) – A Ray class which will be based on the vector and matrix class Game Engine - Minimum Functionality • Unit vector (for vector class) • Magnitude of a vector (for vector class) • Invert a vector (for vector class) • Add two vectors (for vector class) • Subtract two vectors (for vector class) • Dot product vector (for vector class) • Cross product vector (for vector class) • Addition (for matrix class) • Subtraction (for matrix class) • Multiplication (for matrix class) • Transpose (for matrix class) • Inverse (for matrix class) • Calculate distance between two rays (for ray class) • Calculate distance between a ray and a point (for ray class) 18/02/2019 2 Game Engine - Extra Features • Extra credit will be given for adding more features to the classes Game Specification • The traditional 2D Breakout is one of the first interactive video games available on personal computers • The main idea is to knock down a set of 2D bricks using a 2D racket and a ball moving at constant speed • As soon as the ball collides with a brick then it vanishes • The goal of the game is to make all bricks disappear from the game arena • To increase the level of difficulty and game-play, later versions make use of multiple rackets and balls and vary the speed of the ball Game Specification . • The 3D Breakout, a cylindrical wall that consists of 3D bricks, exists in the middle of the simulation area Game Specification .. • A single player controls three curved bats, each positioned at an angle of 120 degrees to each other • The bats can move clockwise or anticlockwise using the keyboard arrow keys as input • The cylindrical wall is situated in the middle of the circle and is constructed by twelve bricks in such a way that it looks like a shaft • The main idea of the 3D game is to knock down all the 3D bricks and ‘destroy’ the well Game - Graphics Minimum Implementation • Colour – Bats, Ball and Bricks of the well • Manipulate the scene – Rotate, translate and scale • Change camera positions – Perspective view, top view and ball view • Transparency – Bats and bricks of the well • Add lighting to the game – Ambient light, diffuse light and specular light • Record the score • Texturing – Ground Game - Graphics Extra Features • Appropriate gaming scenario • Logo introduction page • Increase/decrease the speed of the ball • Use of textures to the bricks and bats • Add sound • Special effects 18/02/2019 3 Game - Physics Minimum Implementation • Construct from scratch a gaming environment – Three bats – One well – A ground – One ball • A real-time simulation of a ball • Collision detection between: – Ball-bats – Ball-well – Ball-Invisible wall Game - Physics Extra Features • Extra credit will be given for adding more features to the game • Some ideas for improvement include the following: – Friction – Weight – Make the ball bounce – Gravity – Deformations Report Structure • Title page • Contents • Abstract (or summary) • Introduction • Background theory • Methodology and results • Conclusions • References • Appendices