Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Desert Racer

Overview

Your task is to build a 3D driving game that not only looks good, but is fast enough to play in realtime !* In order to achieve this, you will need to implement a "hybrid" rendering engine such that:

· Some model elements are rasterised (for speed of rendering)

· Some model elements are ray traced (so that they look good) BUT their pixels are pre-calculated (for speed of play)

· Some model elements are flat images, rather than 3D models (for speed of rendering)

An animated demonstration video of the game is provided to give you an idea of what to aim for. The following sections of this document provide more details regarding the features that you should implement.

Vehicle Model

In this game, you get to choose the vehicle that the player will drive - you will need to find a suitable OBJ file for

this vehicle. You can optionally use a model with a texture map in order to give your vehicle a "paint job". You

should pre-rendered your chosen vehicle in a number of different orientations (i.e. forwards, turning-left, turning-  right) Pre-computing these views is possible because the vehicle should always stay in the same position on the    screen relative to the camera. These vehicle renders MUST be rendered when the game starts up (i.e. they should NOT be just flat images loaded in from file) This is so that we could use an alternative model if we wished to.

Terrain

The desert's surface should be rendered as a horizontal flat grey area. If you are feeling ambitious however, you can give the surface extra depth by using a tiled bump/normal map (see "surface-map.jpg") In the interests of

rendering performance, you can precompute AoI lighting assuming light position always remains fixed. In addition to the local area of the desert, you should also render the horizon/far distance of the desert. This is done using a  flat image (rather than a 3D model) this image is provided for you in a file called "scenery.jpg". Your job is to draw the correct rectangular area of this image for the current heading of the vehicle. Note that you will need to

implement a "wrap around" feature for the scenery image in order to achieve a seamless 360 environment.

Obstructions

There are two different types of obstructions in the game that can block the path of a driving vehicle:

· Grey block walls: vertices read in from the "cube.obj" file and then randomly positioned within the game.

· Coloured bouncing balls: read in from the "sphere.obj" file, given a random colour (red, green or blue) and then randomly positioned within the game.

The grey block walls should be rasterised (for speed of rendering). Spheres on the other hand should be rendered using either flat, Gouraud or Phong shading (depending on your level of ambition). Sphere renderers should be

pre-computed when the game starts (for speed of rendering). You will need to store the rendered pixels in a

suitable buffer and then insert these into the game as appropriate to achieve the required bouncing animation. As an extension, you might like to add some reflective objects occasionally in the game (if you are feeling ambitious). It is up to you to reach a balance between quality of rendering and speed of gameplay.

Game Physics

Your game should include keyboard event handlers that allow the user to control the vehicle using the following cursor keys:

· left/right to change direction

· up/down to increase/decrease speed (as well as reversing) You should implement collision detection between various objects so that it should not be possible to drive through grey blocks (vehicle should just stop when    they hit them). In addition, when the vehicle impacts with a bouncing sphere, it should bounce back (i.e. be

knocked into reverse). You should implement a simple collision detection algorithm that uses the distance between model object centre points (origins) as a basis for determining when objects come into contact.

Submission

You should submit the following three materials via the summer resit Blackboard submission point:

· C++ code for your game

· MP4 screen recording of your game being played

· README file listing all of the features that you have implemented

Minimum pass requirements

In order to pass the assignment you will need to implement a playable game which successfully implements at least the following features:

· Load and rasterise cubes and stationary spheres (from OBJ files) placed at random locations around the game · Load and rasterise (un-textured) the main vehicle in 3 orientations (forwards, turning-left, turning-right)

· Rasterise the grey ground surface in a suitable position

· Keyboard event handlers to allow the vehicle to be driven around the scene (left/right, accelerate/decelerate)