Microsoft Word - project2.docx CSCE4813–ComputerGraphics ProgrammingProject2–DueFriday02/14/2020 ProgrammingProject3–DueMonday02/24/2020 1.ProblemStatement:...

1 answer below »
Just need project 3, i will attach project 2 and can change anything you want from it. I also just need the code, don't worry about the testing/ project report.


Microsoft Word - project2.docx CSCE4813–ComputerGraphics ProgrammingProject2–DueFriday02/14/2020 ProgrammingProject3–DueMonday02/24/2020 1.ProblemStatement: Thegoalofthistwo-partprogrammingprojectistodesignandimplementavideo gamecalled“angrybricks”modeledafterthewellknown“angrybirds”game.Inour game,theplayerwillgrabontoabrickthatisdisplayedonthelowerleftsideofthe screenwiththeirmouse,dragittotheleft,andwhentheyreleasethemouse,the brickwill“slingshot”towardsatargetontheright.Asthebrickmovesacrossthe screen,itwillrotateinthreedimensions,andfalltowardsthegroundduetheeffects ofgravity.Whenabrickhitstheleftorrightwallitwill“bounce”intheopposite direction.Thebrickwillfinallystopwhenithitstheground.Thegoalofthisgame istoselectatarget,andseeifyoucanslingshotthebricktothatlocation. Project2–Creatinganddisplayingthebrick YourfirsttaskistocreateanOpenGLprogramthatdisplaysacolorfulbrickata fixedlocationonthescreenusingthedisplaycallback.Todothis,youwillhaveto calculatethe(x,y,z)locationsofall8cornersofthebrick,anddefinethe6facesof thebrickusingpolygonswithdifferentcolors. Onceyouhavethisworking,youcancreateamousecallbackfunctionthatcaptures the(x,y)locationofthemouse,andredrawsthecolorfulbrickatthatlocation.As youmoveyourmousearoundandclickindifferentlocations,thebrickshouldbe erasedfromthescreenandredrawninthenewlocation.Thekeytothisprocess willbeconvertingfromthe(x,y)windowcoordinatesinto(x,y,z)objectcoordinates fordisplaypurposes. Finally,youneedtocreateamotioncallbackfunctionthatcapturesthe(x,y)window coordinatesofthemouseasyoudragitacrossthescreen.Asthemousemoves,you shouldredrawthebrickatthecorresponding(x,y,z)locationinobjectcoordinates. Fordebuggingpurposes,youmaywanttoprintoutthe(x,y)windowand(x,y,z) objectcoordinatesastheyarechanging. Project3–Simulatinganddisplayingbrickmotion Inordertosimulatebrickmotionyouneedtocalculatethevelocityvectorfrom your“slingshot”.Todothis,youcanrecordthe(x1,y1)locationwherethemouse wasclicked,andthe(x2,y2)locationwherethemousewasreleased,andsubtract thesetogetthedirectionandspeedofthebrickinobjectcoordinates. Yournexttaskistousetheidlecallbackorthetimercallbackto“simulatephysics” andupdatethe(x,y,z)locationofthebrickateachtimestepandredisplaythebrick. Thetrickyparthereistofindastepsizethatresultsin“natural”lookingmotion.If thestepsizeistoolarge,thebrickwillmovetooquickly.Ifthestepsizeistoosmall, thebrickwillmoveinslowmotion. Inordertosimulatethebrick“bounce”youwillhavetofigureoutwhenthebrick hitstheleftorrightwall,andupdatethebrickpositionandvelocityaccordingly.To keepthingssimple,youcanassumethatthebrickhitsthewallsquarelyand bouncesoffperfectlyintheoppositedirectionwithoutchangeinspeedandwithout introducinganystrangebrickrotations. Finally,itwouldbenicetoseethebrickrotateslowlyasitmovesacrossthescreen. Todothis,youshouldkeeptrackofthecurrentlocationandrotationanglesforthe brickateachtimestep.ThenyoucanusetheglLoadIdentity,glRotatef,and glTranslateffunctionstoupdatetheGL_MODELVIEWmatrixpriortodrawingthe brick.Thiswillmakeyourbrickrotateasitmoves.Again,youneedtoselectyour rotationstepsizesoitisnottoofastandnottooslow. 2.Design: Thereareseveraldesigntasksyoumustcompleteforthisproject.First,youmust designyourbrickmodel(acollectionof6polygonsshouldbeenough).Next,you needtodecidewheretopositionthebrick,andhowtodetectwhentheuserhas clickedonthebrick.Todothis,youwillneedtoconvertfrom“screencoordinates” to“objectcoordinates”. Yournexttaskistoworkouttheequationsneededto“simulatephysics”soyoucan calculatethe(x,y,z)locationsofthebrickasitisflyingacrossthescreen.Ifyou ignoretheeffectsofwindonthebrick,itshouldfollowaparabolicpath.Finally,you needtofigureouthowyouwilldetectwhenthebrickhitsthewallortheground, andadjustthepositionandvelocityaccordingly. 3.Implementation: ThissemesterwewillbeusingC++andOpenGLtoimplementallofour programmingprojects.IfyouareusingaMacwithXcodeinstalled,thenyoucan downloadthesrc.tarfileandcompilethesamplegraphicscodeusingtheenclosed Makefile.IfyouareusingaPC,thenyourbestoptionwouldbetodownloadand installaLinuxVMfromthedepartment’swebsite.Theinstructionsfordoingthis arepostedinREADMEfilethe“SourceCode”pageoftheclasswebsite.Onceyou haveLinuxandOpenGLinstalled,youcancompileyourgraphicsprogramusing “g++-Wallproject2.cpp-oproject2-lGL-lGLU-lglut”. Usingoneoftheprogramsinthesourcedirectoryasastartingpoint,youcanadd codetothe“display”functiontodisplayyourbrickonthescreen.Youwillneedto makeuseofthe“mouse”callbacktodetectwhentheuserhasselectedthebrick,and the“motion”callbacktotrackthemotionofthemouseastheuserdragsittothe left,andthe“idle”or“timer”functiontoupdatethelocationandorientationofthe brickafterithasbeenreleasedbytheslingshottowardsthetarget. Remembertouseincrementaldevelopmentandgoodprogrammingstylewhen creatingyourprogram.Choosegoodnamesforvariablesandconstants,useproper indentingforloopsandconditionals,andincludeclearcommentsinyourcode.Also, besuretosavebackupcopiesofyourprogramsomewheresafe.Otherwise,youmay endupretypingyourwholeprogramifsomethinggoeswrong. 4.Testing: Testyourprogramtocheckthatitoperatescorrectlyforalloftherequirements listedabove.Alsocheckfortheerrorhandlingcapabilitiesofthecode.Tryyour programwithseveralinputvalues,andsavescreenshotsofyouroutputinjpeg imagesforinclusioninyourprojectreport. 5.Documentation: WhenyouhavecompletedyourC++program,writeashortreportusingtheproject reporttemplatedescribingwhattheobjectiveswere,whatyoudid,andthestatusof theprogram.Doesitworkproperlyforalltestcases?Arethereanyknown problems?Savethisreporttobesubmittedelectronically. 6.ProjectSubmission: Inthisclass,wewillbeusingelectronicprojectsubmissiontomakesurethatall studentshandtheirprogrammingprojectsandlabsontime,andtoperform automaticplagiarismanalysisofallprogramsthataresubmitted. WhenyouhavecompletedthetasksabovegotoBlackboardtouploadyour documentation(asingledocxorpdffile),andallofyourC++programfiles.DoNOT uploadanexecutableversionofyourprogram. Thedatesonyourelectronicsubmissionwillbeusedtoverifythatyoumetthedue dateabove.Alllateprojectswillreceivereducedcredit: • 10%offiflessthan1daylate, • 20%offiflessthan2dayslate, • 30%offiflessthan3dayslate, • nocreditifmorethan3dayslate. Youwillreceivepartialcreditforallprogramsthatcompileeveniftheydonotmeet allprogramrequirements,sohandingprojectsinontimeishighlyrecommended. 7.AcademicHonestyStatement: Studentsareexpectedtosubmittheirownworkonallprogrammingprojects, unlessgroupprojectshavebeenexplicitlyassigned.StudentsareNOTallowedto distributecodetoeachother,orcopycodefromanotherindividualorwebsite. StudentsAREallowedtouseanymaterialsontheclasswebsite,orinthetextbook, orasktheinstructorand/orGTAsforassistance. Thiscoursewillbeusinghighlyeffectiveprogramcomparisonsoftwaretocalculate thesimilarityofallprogramstoeachother,andtohomeworkassignmentsfrom previoussemesters.Pleasedonotbetemptedtoplagiarizefromanotherstudent. ViolationsofthepoliciesabovewillbereportedtotheProvost'sofficeandmay resultinaZEROontheprogrammingproject,anFintheclass,orsuspensionfrom theuniversity,dependingontheseverityoftheviolationandanyhistoryofprior violations.
Answered Same DayFeb 20, 2021

Answer To: Microsoft Word - project2.docx CSCE4813–ComputerGraphics...

Aditya answered on Feb 25 2021
148 Votes
ab/ab.cbp

    
    
        
        
        
        
            
                
                
                
                
                
                
                    
                
            
            
                
                
                
                
                
                
                    
                
                
                    
                
            
        
        
            
            
        
        
            
            
            
            
            
            
        
        
        
            
            
            
        
    
ab/ab.depend
# depslib dependency file v1.0
1582579814 source:c:\users\shankha\documents\ab\main.cpp
    ws.h>
    "GL/glut.h"
    
    
    
1582549670 c:\program files (x86)\codeblocks\mingw\include\gl\glut.h
    
    
    
1301111162 c:\program files (x86)\codeblocks\mingw\include\windows.h
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
1301111162 c:\program files (x86)\codeblocks\mingw\include\winresrc.h
    
    
    
    
    
    
1301111164 c:\program files (x86)\codeblocks\mingw\include\winuser.h
1301111162 c:\program files (x86)\codeblocks\mingw\include\winnt.h
    
    
    
    
    
1301111162 c:\program files (x86)\codeblocks\mingw\include\winerror.h
1341006776 c:\program files (x86)\codeblocks\mingw\include\string.h
    <_mingw.h>
    
1341006770 c:\program files (x86)\codeblocks\mingw\include\_mingw.h
1301111148 c:\program files (x86)\codeblocks\mingw\include\basetsd.h
1301111156 c:\program files (x86)\codeblocks\mingw\include\pshpack4.h
1301111156 c:\program files (x86)\codeblocks\mingw\include\poppack.h
1301111164 c:\program files (x86)\codeblocks\mingw\include\winver.h
1301111148 c:\program files (x86)\codeblocks\mingw\include\dde.h
1301111150 c:\program files (x86)\codeblocks\mingw\include\dlgs.h
1301111148 c:\program files (x86)\codeblocks\mingw\include\commctrl.h
    
1301111156 c:\program files (x86)\codeblocks\mingw\include\prsht.h
1301111162 c:\program files (x86)\codeblocks\mingw\include\windef.h
    
1301111162 c:\program files (x86)\codeblocks\mingw\include\wincon.h
1301111160 c:\program files (x86)\codeblocks\mingw\include\winbase.h
1301111162 c:\program files (x86)\codeblocks\mingw\include\wingdi.h
1301111162 c:\program files (x86)\codeblocks\mingw\include\winnls.h
1301111162 c:\program files (x86)\codeblocks\mingw\include\winnetwk.h
1301111162 c:\program files (x86)\codeblocks\mingw\include\winreg.h
1301111164 c:\program files (x86)\codeblocks\mingw\include\winsvc.h
1301111148 c:\program files (x86)\codeblocks\mingw\include\cderr.h
1301111148 c:\program files (x86)\codeblocks\mingw\include\ddeml.h
1301111150 c:\program files (x86)\codeblocks\mingw\include\imm.h
1301111154 c:\program files (x86)\codeblocks\mingw\include\lzexpand.h
1301111154 c:\program files (x86)\codeblocks\mingw\include\mmsystem.h
1301111154 c:\program files (x86)\codeblocks\mingw\include\nb30.h
1301111158 c:\program files (x86)\codeblocks\mingw\include\rpc.h
    
    
    
    
    
    
1301111158 c:\program files (x86)\codeblocks\mingw\include\rpcdce.h
    
    
1301111148 c:\program files (x86)\codeblocks\mingw\include\basetyps.h
1301111158 c:\program files (x86)\codeblocks\mingw\include\rpcdcep.h
1301111158 c:\program files (x86)\codeblocks\mingw\include\rpcnsi.h
1301111158 c:\program files (x86)\codeblocks\mingw\include\rpcnterr.h
1341006772 c:\program files (x86)\codeblocks\mingw\include\excpt.h
    <_mingw.h>
    
1301111160 c:\program files (x86)\codeblocks\mingw\include\shellapi.h
    
    
1301111156 c:\program files (x86)\codeblocks\mingw\include\pshpack2.h
1301111162 c:\program files (x86)\codeblocks\mingw\include\winperf.h
1301111148 c:\program files (x86)\codeblocks\mingw\include\commdlg.h
    
    
1301111160 c:\program...
SOLUTION.PDF

Answer To This Question Is Available To Download

Submit New Assignment

Copy and Paste Your Assignment Here