” 辅导5CCGD003W课程、 写作Programming编程5CCGD003W: 3D Graphics ProgrammingCoursework 1 2D Game (2020/21)Module leader Dr Anastassia AngelopoulouUnit Coursework 1 REFERRED/DEFERREDWeighting: 40%Qualifying mark 30%Description 2D Game or GUI applicationLearning OutcomesCovered in thisAssignment:This assignment contributes towards the following LearningOutcomes (LOs): LO1 Use appropriate data structures for storing vertices,faces and edges that define the shape of objects andmanipulate such objects by applying differenttransformations; LO2 Be able to design and implement 2D real-timescenes that respond to user interaction; LO5 Be able to critically assess the current problems andappreciate some of solutions available through practicalexercises and demonstrate knowledge and appreciationof some research related issues in computer graphics; LO6 Communicate and present ideas by oral, visual andwritten meansHanded Out: 09/06/2021Due Date 06/07/2021 at 13:00Expected deliverables cpp file(s)Method ofSubmission:Electronic submission on BBType of Feedback andDue Date:Formative feedback will be provided during tutorial sessions.Verbal feedback on the submitted CW will be provided duringthe CW presentation/viva. Students are encouraged to recordthis feedback at this time.Note: All marks will remain Provisional until formally agreed byan Assessment Board.3D Graphics Programming – Coursework One – Referred/Deferred 5CCGD003W2 @Dr Anastassia AngelopoulouAssessment regulationsRefer to Student Handbook guide for undergraduate students for a clarification ofhow you are assessed, penalties and late submissions, what constitutes plagiarismetc.Penalty for Late SubmissionIf you submit your coursework late but within 24 hours or one working day of thespecified deadline, 10 marks will be deducted from the final mark, as a penalty forlate submission, except for work which obtains a mark in the range 40 49%, inwhich case the mark will be capped at the pass mark (40%). If you submit yourcoursework more than 24 hours or more than one working day after the specifieddeadline you will be given a mark of zero for the work in question unless a claim ofMitigating Circumstances has been submitted and accepted as valid.It is recognised that on occasion, illness or a personal crisis can mean that you fail tosubmit a piece of work on time. In such cases you must inform the Campus Office inwriting on a mitigating Circumstances form, giving the reason for your late or nonsubmission.You must provide relevant documentary evidence with the form. Thisinformation will be reported to the relevant Assessment Board that will decidewhether the mark of zero shall stand. For more detailed information regardingUniversity Assessment Regulations, please refer to the followingwebsite:BCS Criteria meeting inthis assignment:2.1.1 Knowledge and understanding of facts, concepts, principles theories2.1.5 Deploy theory in design, implementation and evaluation ofsystems2.1.8 Knowledge of management techniques to achieveobjectives2.2.1 Specify, design or construct computer-based systems2.2.4 Deploy tools effectively2.3.2 Development of general transferable skills4.1.2 Knowledge and understanding of mathematical andstatistical principles4.1.3 Knowledge and understanding of computational modelling4.2.1 Specify, deploy, verify and maintain computer-basedsystems3D Graphics Programming – Coursework One – Referred/Deferred 5CCGD003W3 @Dr Anastassia AngelopoulouCoursework OneNotes:1) In order to pass the referred coursework significant improvements over anypreviously submitted version must be demonstrated.2) You MUST attend a viva this is part of the assessment. No viva MAXIMUMmark of 30%3) For referred cws only, in the viva you need to explain the improvements youhave made to previous submitted versions.This coursework is worth 40% of the total module mark.Please read carefully and read all sections. Raise any issues about this courseworkearly with your lecturer/tutor. Also see additional support code on the Blackboardsite for the module under Assessment.Learning Outcomes:1. Creation of 2D Graphics and the orthographic projection2. Creating objects from primitives3. Transformations4. Correct use of GLUT and OpenGL libraries5. Writing understandable code6. User interaction7. Simple Collision DetectionDescriptionYou are to build either a simple 2D game in OpenGL by using the Freeglut library,already provided to you in the first tutorial or a simple 2D drawing canvas with a title.You should choose ONLY ONE scenario to implement. It is entirely up to you whichof the two you choose. Both of them carry equal marks.Note::: You also need to upload a video link where you will explain the CW and thecode. The video link should cover the marking scheme criteria and you shouldexplain all different parts of the code, for example, collisions, mouse or keyobardinteraction, etc. Please keep the video short and not more than 5min.Game ScenarioThe game is loosely based on the classic 80s games.A mock-up of the 2D Car game screen is shown in figures 1 and 2.3D Graphics Programming – Coursework One – Referred/Deferred 5CCGD003W4 @Dr Anastassia AngelopoulouFigure 1: A simple car with obstacles placed on the screen and a score panelFigure 2: A detailed diagram of the different featuresThe game scenario consists of a racing car that needs to navigate through a simpletrack as shown above. The car must avoid the hazards (5 randomly placed squareblocks) and exit at the green gate.The car waits at the Red gate until the user presses an arrow key to move the car.The car shall turn/rotate to the appropriate orientation depending on which key willbe pressed next. The user moves the car around the hazards and out of the greengate. Once the car has reached the green gate the game ends. If the car collides witha square then 10 points are deducted from the score. The score starts from 50. Asuccessful game will lead to the award of 50 points (if no hazards are hit). Once thecar has exited the green gate the hazard blocks should re-spawn in differentpositions (but not in contact with each other or on top of the car at the start gate).The score shall accumulate until the application is closed.3D Graphics Programming – Coursework One – Referred/Deferred 5CCGD003W5 @Dr Anastassia AngelopoulouTechnical DetailsThe screen consists of several objects:a) The car (controlled by left/right/up/down arrow keys or any other gamerelated keys such as A/D from the WASD keys)b) The obstaclesc) The play area (white grid) and the 2 gatesd) The score panele) The pop-up menuf) Some information about user interaction from the consoleNotes: All the shapes in the figure are built from simple primitives and you are freeto copy this design without penalty.User RequirementsR1: If the left key is pressed the car moves leftR2: If the right key is pressed the car moves rightR3: If the up key is pressed the car moves upR4: If the down key is pressed the car moves downR5: If the R key is pressed the car turn/rotates to the appropriate orientationR6: Right click to bring up a pop-up menu with optionsSoftware RequirementsR7: By default, the application should load and show the car, the obstacles, the scorepanel, the play area, and the two gatesR8: Objects shall be redrawn randomly for every new set of obstaclesR9: Every time an obstacle is hit the score reduces by 10 points.2D drawing canvas scenarioYou are to build a Simple 2D drawing canvas with a title. The tool should have twomenus one on the left and one on the top from where you can choose primitives orshapes to draw on the canvas. The shapes are in the form of non-filled and filledpolygons (see menus on left and right). See figure 3 below.3D Graphics Programming – Coursework One – Referred/Deferred 5CCGD003W6 @Dr Anastassia AngelopoulouFigure 3: A simple drawingThe figure shows the menus, a highlighted primitive, in this case a line, (e.g., leftmenu) a simple drawing in the middle of the canvas and text at the bottom of thescreen. You should be able to draw lines by clicking on a starting and an ending pointin the canvas. Appendix A shows some starting code. Figure 1 shows two versions;one with grid and one without a grid. You should be able to turn the grid on and offwith the help of a pop-up menu as can be seen on the right version.Animation in the Pop-up menuThe pop-up menu has 3 options. To turn the grid on and off and to start anAnimation. The Animation is a polygon shaped filled field (Figure 4) that drifts frombottom to top with new shapes appearing from the bottom as the old shapesdisappear. Not all shapes have the same speed. Appendix B shows some startingcode. Some shapes move faster than others. The shapes should be drawn by usingpolygons with fill polygon mode. Note:: You should use blended colours to give theimpression of texture on the polygonal shapes.Figure 4: An animated filled-polygon field that drifts from bottom to top.3D Graphics Programming – Coursework One – Referred/Deferred 5CCGD003W7 @Dr Anastassia AngelopoulouControlsYou should clear all the drawings from the canvas by pressing the space bar and exitthe application by pressing the escape key. You should also clear specific primitivesby pressing the relevant key. Finally, you should be able to use the special keys, up,down, left and right to move the shapes. Basic collision between shapes and thebars should be applied. There is no collision between the shapes. Shapes can overlapeach other.Technical DetailsAn Orthographic projection should be used and the canvas consists of severalelements:a) A titleb) Two menu bars with primitivesc) Inactive areas within the barsd) Pop-up menu where the user can turn on and off the gride) Moving polygon shaped filled fieldf) A grid with dashed polylinesg) A highlighted area when the selected primitive or shape is clicked onh) Key control to clear off all the drawings and quit the applicationi) Key control to clear specific group of primitives e.g. all lines, all circles, etc.j) Some information About user interaction from the console (see figure below)Figure 4: Output and instructions on the consoleNotes: All the shapes in the figure are built from simple primitives and you are freeto copy this design without penalty.User RequirementsR1: If the l key is pressed all lines should be cleared from the canvasR2: If the t key is pressed all triangles should be cleared from the canvasR3: If the p key is pressed all points should be cleared from the canvasR4: If the c key is pressed all circles should be cleared from the canvasR5: If the r key is pressed all rectangles should be cleared from the canvasR6: If the escape key is pressed the application should quitR7: If the space bar is pressed the canvas is clearedR8: If the special keys are pressed the primitives can be moved3D Graphics Programming – Coursework One – Referred/Deferred 5CCGD003W8 @Dr Anastassia AngelopoulouR9: Left click to select shapes from the menusR10: Left click on the drawing area to drawR11: Right click to bring up a pop-up menuSoftware RequirementsR12: By default, the application should load and show the two menu bars, a title andthe grid onR13: Objects shall be drawn inside the canvasR14: The titles and labels shall accurately reflect the application.R15: The Animation should stop when other options from the pop-up menu areselectedImportant Notes:Make sure you attempt all of the above.Create C/C++ functions that are sensibly named such as: drawAsteroids(),drawObstacles(), drawSpaceship(), asteroidCollision() , drawHit (..),createMenu(), etc.You can also use C++ classes if you know how to.Note even if you achieve a requirement you may not get full marks if it isperceived by the marker that a better solution was possible.All work is marked in a viva (THE VIVA IS COMPULSORY) and the markersacademic judgment is final and cannot be questioned.Note that the maximum mark for work marked without aviva/demonstration will be 30%.Please comment your code extensively and put the author of any code thatis not your own in the comments above the code section. Note you may losemarks for uncommented code.ABSOLUTELY DO NOT COPY A SOLUTION TO THIS FROM THE INTERNET.Please submit your code via Blackboard by 1PM on the due date.—————–TIPS:Design your Application before coding.3D Graphics Programming – Coursework One – Referred/Deferred 5CCGD003W9 @Dr Anastassia AngelopoulouMark Breakdown and Guidelines note this will be marked using aBlackboard rubric during a compulsory vivaNote::: Not full marks will be given per section, even if the components have beenfully implemented, if the student cannot explain satisfactorily the code to the tutor.GameGLUT set up and console output- 7%Not done -0%Some code not workingmax 1%Works butnot correctlyor has othermajor defectsuch as noconsoleoutputmax 3%Minorinconsistency ordefect (singlebuffer leading topoor redrawetc.)max 5%All correct sensibly namescall backs/projectioncorrectmax 7%Comment:Car model and Navigation control model and rotation code (15% for modelprimitives and 15% for rotation code and user controls – e.g. rotation, move of thecar left/right/up/down) – 30%Not done -0%Some code,partiallyworkingmax 9%Works butnot correctlyor has othermajor defect(no usercontrol forrotation ofthe car)max 18%Working butminorinconsistencyor defect(such as notwell coded,jerky motion)max 24%Works correctly nojerky movement,good model andsmooth movementof the car androtation to thecorrect directionmax 30%Comment:Collision code for Obstacles and re-spawning (5% for the model and 20% forrandom or predetermined Redraw code with working collision detection) 25%3D Graphics Programming – Coursework One – Referred/Deferred 5CCGD003W10 @Dr Anastassia AngelopoulouNot done -0%Some code,partiallyworking, nocollisionsmax 5%Static only ormajor defectsuch as noredraw or carcollision isnot workingproperlymax 12%Some minorinconsistencyor defect ornot randomlygeneratedredrawsmax 19%Works as requiredwith no issuesmax 25%Comment:Play area and Gates- 5%Not done -0%Some code not workingmax 1%Works butnot correctlyor has othermajor defectsuch as noplay areadefinedmax 3%Minorinconsistency ordefect, such assame colour forthe gatesmax 4%All correct max 5%Comment:Mouse interaction for the pop-up menu (e.g. grid and pattern code) -11%Not done -0%Some code,partiallyworking suchas staticpattern whenthe screenloadsmax 4%Works butnot correctlyor has othermajor defectsuch as onlyone option toclickmax 6%Minor issues mostly worksbut has minorissues (e.g.the patternand grid onlychange once)max 8%All correct efficient code easy to extend.max 11%Comment:3D Graphics Programming – Coursework One – Referred/Deferred 5CCGD003W11 @Dr Anastassia AngelopoulouWorking Score panel 12%Not done -0%Some code,partiallyworking oronly statictextmax 4%Works butnot correctlyor has othermajor defectmax 6%Working butminorinconsistencyor defect, forexample,points are notdeductedfrom thegamemax 8%Works as requiredwith no issuesmax 12%Comment:Explanation of code/Computer Graphics principles in the viva -10%Very poor ornounderstanding(wouldprobably failthecoursework)0%Weakunderstanding cannotexplain codethough stillhas someknowledge.Code isunclear anddifficult tounderstandmax 3%Some majorgaps inknowledge.Nocomments inthe codemax 5%Some minorweakness inknowledge need to revisesome points.Names in thevariable notappropriateor difficult tounderstandmax 7%Goodunderstanding can answer allquestions andunderstands allcode.max 10%Comment: Tutor should point out areas that thestudent should revise or strengthen theirknowledge of (if required).3D Graphics Programming – Coursework One – Referred/Deferred 5CCGD003W12 @Dr Anastassia AngelopoulouMark Breakdown and Guidelines2D Drawing CanvasGLUT set up, console output and Title- 7%Not done -0%Some code not workingmax 2%Works butnot correctlyor has othermajor defectsuch as noconsoleoutput orTitlemax 4%Minorinconsistency ordefect (singlebuffer leading topoor redrawetc.)max 5%All correct sensibly namescall backs/projectioncorrectmax 7%Comment:Visualisation code of the grid data- 8%Not done -0%Some code,partiallyworkingmax 2%Works butnot correctlyor has othermajor defect- only verticalor horizontallinesmax 5%Minor issues straight linesused insteadof dashedpolylinesmax 7%Complete andcorrect.max 8%Comment:Visualisation code of the canvas – 25%Not done -0%Some code,partiallyworking(only drawingof objects)max 7%Works butnot correct.Or has othermajor defect(only onemenu bar, noinactiveareas)Minor defect.Mostly correctwith minorissues such asno highlightedprimitivesmax 20%Complete andcorrect.max 25%3D Graphics Programming – Coursework One – Referred/Deferred 5CCGD003W13 @Dr Anastassia Angelopouloumax 13%Comment:Drawing on the canvas – 20%Not done -0%Some code,partiallyworking(drawing onlya single lineor point)max 5%Works butnot correct.Or has othermajor defect(drawingstarts alwaysfrom thecentre or candraw only inone area)max 10%Minor defect.Mostly correctwith minorissues such asdrawing goesover theinactive areasof the menubarsmax 15%Complete andcorrect.max 20%Comment:Animation – 13%Not done -0%Some code,partiallyworking(only staticpolygon field)max 5%Works butnot correct.Or has othermajor defect(covers thewhole canvasarea, driftsfrom bottomto top onlyonce)max 8%Minor defect.Mostly correctwith minorissues such asno colourblending ofthe shapesmax 11%Complete andcorrect.max 13%Comment:Mouse interaction for the menu bars and the pop-up menu -8%Not done -0%Some code,partiallyworking(no pop-upmenu butMajor defect(pop-upmenu withonly 1 optionno mouseMinor issues mostly worksbut has minorissues.max 6%All correct efficient code easy to extend.max 8%3D Graphics Programming – Coursework One – Referred/Deferred 5CCGD003W14 @Dr Anastassia Angelopoulousome mouseclicks)max 2%control in thedrawingarea)max 4%Comment:Key controls and Collision with the bars -9%Not done -0%Some code not workingmax 2%Works butnot correctlyor has othermajor defect wrong keysassigned/onlypartiallyworking, nocollision withthe barmax 5%Minorinconsistencyor defectmax 7%All correct andworkmax 9%Comment:Explanation of code and good writing of code -10%Very poor ornounderstanding(wouldprobably failthecoursework)0%Weakunderstanding cannotexplain codethough stillhas someknowledge.Code isunclear anddifficult tounderstandmax 3%Some majorgaps inknowledge.Nocomments inthe codemax 5%Some minorweakness inknowledge need to revisesome points.Names in thevariable notappropriateor difficult tounderstandmax 7%Goodunderstanding can answer allquestions andunderstands allcode.max 10%Comment: Tutor should point out areas that thestudent should revise or strengthen theirknowledge of (if required).3D Graphics Programming – Coursework One – Referred/Deferred 5CCGD003W15 @Dr Anastassia AngelopoulouAppendix AThis is an example of a line class to be able to draw a line. You can followsimilar concept for other shapes such as triangles and rectangles.// Line classclass Line{public:Line(int x1Val, int y1Val, int x2Val, int y2Val){x1 = x1Val; y1 = y1Val; x2 = x2Val; y2 = y2Val;}void drawLine();private:int x1, y1, x2, y2; // x and y co-ordinates ofendpoints.};3D Graphics Programming – Coursework One – Referred/Deferred 5CCGD003W16 @Dr Anastassia AngelopoulouAppendix BFor example, you can use structures to store the data for the shapes.//structure for the animated shapesstruct Shapes {GLfloat x, y;GLfloat vx, vy;};//the randomised function assigns different numbers to thecoordinates and their velocity. this helps with thedifferent speed to the shapesfor (i = 0; i num_shapes; i++){shapes[i].x = rand() % weidth ;shapes[i].y = rand() % height ;shapes[i].vx = (rand() / (float)RAND_MAX) * 3;shapes[i].vy = (rand() / (float)RAND_MAX) * 5;}请加QQ:99515681 或邮箱:99515681@qq.com WX:codehelp
“
添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导。