C++ Assignment
EIGA501 Introduction to 3D Graphics – Coursework One version 1.1 - 2013
1
EIGA501 – Introduction to 3D Graphics Module leader: Philip Trwoga Unit: Coursework 1 Weighting: 25% Qualifying mark: 30% Description: 3D Game Learning Outcomes Covered in this Assignment:
Creating objects from primitives Transformation Use of Pull/Push Matrix Simple collision detection Correct use of GLUT library Writing understandable code User interaction Real-‐time graphics
Handed Out: 7th October 2013 Due Date: 11/11/13 at 10am via Blackboard Expected deliverables Cpp files only
Method of Submission: Electronic submission on BB via a provided link close to the
submission time. The file you upload should have the following structure: Yourfullname_IDnumber.doc or Yourfullname_IDnumber.pdf
Type of Feedback and Due Date:
Feedback will given during student demonstration of the code During Week 8
EIGA501 Introduction to 3D Graphics – Coursework One version 1.1 - 2013
2
EIGA501 Introduction to 3D Graphics
Coursework One This coursework is worth 25% of the total module mark Set: 7th October 2011 Due: 11th November 2013 by 10AM Learning Outcomes:
1) GLUT framework 2) Drawing primitives in OpenGL 3) Rotation transformation 4) Basic collision detection 5) Introduction real-time graphics
Description You are to build a simple 2D game (with some 3D effects) in OpenGL and the by using GLUT toolkit to assist you. The game is loosely based on the classic 80s game ‘Asteroids’. A mock-up of the game screen is shown in figure 1 below. The game will be extended into 3D in coursework 2. The game scenario consists of a spacecraft in the centre of the screen. The ‘asteroids’ appear at the start of the game and the spacecraft can turn freely about its axis by and fire missiles at the asteroids. The asteroids themselves do not translate but rotate slowly about their axis. If a missile fired from the ship strikes an asteroid, the asteroid disappears and the score is increased by 10 points. Once all the asteroids have been hit then new set of asteroids should be redrawn randomly1 on the screen but not drawn in the position where the ship is. The number and shape of the asteroids is up to you. The game goes on indefinitely but feel free to put in a pause or stop. The star field behind the main scene should drift slowly2 from top to bottom or left to right. With new stars appearing as the old stars disappear.
1 Note: Pre-‐determined positions (at least 3 different positions for each asteroid is also acceptable). Random generation will score 5% more in this section. 2 Static (non moving) starts are acceptable but will score less marks – see mark scheme.
EIGA501 Introduction to 3D Graphics – Coursework One version 1.1 - 2013
3
Figure 1 Screen Mock up (asteroids can be filled (GL_POYGON) or line drawn (GL_LINES))
Technical Details The screen consists of several objects:
a) Rotating spaceship (controlled by left/right arrow keys) b) Asteroids (Hexagons are shown here but can be any shape you
choose) c) Moving star field d) The missiles from ship e) The score panel
Notes: All the shapes in the figure are built from simple primitives and you are free to copy this design without penalty or you can create your own shapes. The stars should be drawn by using points (GL_POINT), note that you can change the size of a point with an OpenGL command.
EIGA501 Introduction to 3D Graphics – Coursework One version 1.1 - 2013
4
Note you use blended colours to give the impression of texture on the asteroids and ship. In coursework 2 we will use lighting to achieve this effect but for this coursework use different colour vertices. Deliverable for coursework one:
1. Spacecraft rotation code – model and rotation code (5% for model and 20% for rotation code and user controls) 25%
2. Moving star field (10% only if static) – 20% 3. Spinning asteroid model– 10% 4. Asteroid random or predetermined redraw code – 20% 5. Working Score panel – 15% 6. Collision detection – 10%
(Included in these are marks for coding standard and code quality)
Important Notes: Make sure you attempt all of the above I am not looking for 2D/3D art skills so don’t be too concerned with aesthetics at the moment. Create C/C++ functions that are sensibly named such as drawSpaceShip(…) drawAsteroids(…) asteroidHit(…) rotateShip() etc. Note even if you achieve a requirement you may not get full marks if it is perceived by the marker that a better solution was possible. All work is marked in a viva and the marker’s academic judgment is final should not be questioned. Feel free to include any drawings (concept art and sketches) you have done. Please comment your code extensively and put the author of any code that is not your own in the comments above the code section. Note you will lose marks for uncommented code. Please submit your code via Blackboard by 10AM on the due date by zipping your Visual Studio project. ----------------- End of document