Microsoft Word - project1.docx CSCE4813–ProgrammingProject#1 DueDate–01/31/2020at11:59pm REVISED 1.ProblemStatement:...

1 answer below »
I'll attach files but I just need the programming portion of this. Not the report. I also have source code for the GL part. I have a lot of text/jpg files too that I can't upload all.


Microsoft Word - project1.docx CSCE4813–ProgrammingProject#1 DueDate–01/31/2020at11:59pm REVISED 1.ProblemStatement: Whenspreadsheetsoftwarewasintroducedinthe1980’sitdramaticallychanged howpeoplecouldstore,manipulateandvisualizedata.Thespreadsheet’ssimple userinterfaceenableduserstoeasilyenterrowsandcolumnsofdata,doarithmetic calculations,andmostimportantlydisplaytheresultsineasilyunderstoodcharts. Inthisprogrammingproject,youwillbedevelopingacollectionoffunctionsthat willletuserscreateanddisplaydatausingthefourtypesofchartsabove. Ifwelookcloselyatthesefourcharts,youwillseethatthebackgroundinformation forallfourofthesechartsarethesame. • Theyalldisplayaseriesofevenlyspacedhorizontallines. • TheyalldisplayevenlyspacedticmarksontheXandYaxis. • Theyalldisplaynumericalvaluesadjacenttotheticmarksontheaxes. • Theyalldisplaythenameofthedatafieldbeingdisplayed Themajordifferencebetweenthesefourchartsishowtheyconveyinformation aboutdatavaluesusingdifferentgeometricobjects. • Foracolumnchart,theheightofeachcolumnisdeterminedbythedata valuerelativetotheheightofthechart.Thewidthofeachcolumncanbe determinedbydividingthewidthofthechartbythenumberofdatavalues beingdisplayed. • Forapointchart,datavaluesaredisplayedusingpointsrepresentedby squares,diamonds,orcircles.Inthiscase,theXandYlocationsofpointsare determinedbythemagnitudeofthedatavaluerelativetotheheightand widthofthechart. • Foralinechart,dataisdisplayedusingasequenceoflinesegmentsthat connectthepointlocationsofthedata.Inthiscase,thewidthofthelineis chosentobelargerthanthescalelinessothelinesegmentsarevisible. • Fortheareachart,dataisdisplayedbyfillingintheareaunderthelinechart withasolidcolor.Thisareacanbedefinedusingacollectionofpolygons whereeachpolygonhasonelinesegmentgoingthroughtwodatapointsand threelinesegmentsthatmarktheright,bottom,andleftsidesofthearea beingenclosed. 1.1ChartCreation Forthisprogrammingassignment,yourfirsttaskistoimplementaC++program thatpromptstheusertoenterthenameoftheirinputdatafile,andthetypeofchart theywouldliketocreate(column,point,line,area).Yourprogramshouldthenread intheinputdatafile,dothenecessarycalculationstoscalethisdatatothesizeof theoutputwindow,andthenoutputasequenceofgraphicscommandstocreatethe specifiedchart. Youroutputchartsshouldlookassimilaraspossibletothefourexamplesabove.To simplifythisproject,youareNOTrequiredtooutputthenumbersthatareadjacent totheticmarksinthechartsorthenamedatafieldbeingdisplayed.Youonlyneed todrawlinesinthebackgroundandthegeometricobjectsrepresentingdatavalues. Thefourgraphicscommandswewillbeusingforthisprojectare: • set_color#R#G#B Thiscommandsetsthecolorofthe“pen”inthegraphicsprogram.Allobject drawnafterthiscommandwillbedisplayedwiththiscoloruntilanother set_colorcommandisexecuted.ThecolorvaluesforR,G,Bshouldbe floatingpointvaluesbetween0and1,where0=black,and1=fullcolor. • draw_point#size#x#y Thiscommanddrawsapointofthespecifiedsizeatthespecifiedlocation. Thesizevalueshouldbeanintegerbetween[1..10].The(x,y)coordinates shouldbeintegersbetween[0..width-1]and[0..height-1]respectively. • draw_line#width#x1#y1#x2#y2 Thiscommanddrawsalineofthespecifiedwidthfrom(x1,y1)to(x2,y2). Thewidthvalueshouldbeanintegerbetween[1..10].The(x,y)coordinates shouldbeintegersbetween[0..width-1]and[0..height-1]respectively. • draw_polygon#N#x1#y1#x2#y2…#xN#yN Thiscommandfillsinaconvexpolygonregionthatisdefinedbyasequence ofNpoints.ThevalueNshouldbeanintegergreaterthanorequalto3that specifiesthenumberofpointsonthepolygonboundary.The(x,y) coordinatesofeachpointshouldbeintegersbetween[0..width-1]and [0..height-1]respectively. 1.2ChartDisplay YoursecondtaskistoimplementanOpenGLprogramthatreadsasequenceof commandsintheformatabove,andcallstheappropriateOpenGLcommandsto displaythecorrespondingchartonthescreen.YouwillbegivenaskeletonOpenGL programthatdemonstrateshowtodraweachofthegraphicsprimitivesabove. Todemonstratethecorrectnessofyourprogram,youshouldrunyourfirstprogram tofourtimestogeneratefoursequencesofoutputcommands,andsavethese commandsinfourdatafiles.ThenyoushouldrunyourOpenGLprogramfourtimes togenerateimagesofthesecharts.Whenyourprogramisworking,doscreen capturesofyourfourchartsandincludetheseimagesintoyourprojectreport. 2.Design: Foreachofthecharttypesabove,themajordesigntaskistoworkoutwhat sequenceofgraphicscommandsareneeded,andexactlywhatx_posy_posvaluesto usewhendisplayingthesegeometricobjects.Thekeyhereistoworkoutthescale factorsyouneedtousetoconverttherawdatavaluesintocoordinatesthatare withinthechart.Forexample,ifthedatavaluesgofrom1..100andtheheightofthe chartis500pixels,thenthescalefactorshouldbe500/100=5.Youwillnoticethat thereissmallborderaroundtheoutsideofthedrawingarea.Yourprogramwill needtotakethisborderintoaccountwhendisplayinggraphicsobjects. 3.Implementation: ThissemesterwewillbeusingC++andOpenGLtoimplementallofour programmingprojects.IfyouareusingaMacwithXcodeinstalled,thenyoucan downloadthesrc.tarfileandcompilethesamplegraphicscodeusingtheenclosed Makefile.IfyouareusingaPC,thenyourbestoptionwouldbetodownloadand installaLinuxVMfromthedepartment’swebsite.Theinstructionsfordoingthis arepostedinREADMEfilethe“SourceCode”pageoftheclasswebsite.Onceyou haveLinuxandOpenGLinstalled,youcancompileyourgraphicsprogramusing “g++-Wallshow_chart.cpp-oshow_chart-lGL-lGLU-lglut”. YouareencouragedtolookatsampleOpenGLprogramstoseehowthe“main” functionandthe“display”functionarenormallyimplemented.Asalways,you shouldbreakthecodeintoappropriatefunctions,andthenaddcodeincrementally writingcomments,addingcode,compiling,debugging,alittlebitatatime. Remembertousegoodprogrammingstylewhencreatingyourprogram.Choose goodnamesforvariablesandconstants,useproperindentingforloopsand conditionals,andincludeclearcommentsinyourcode.Also,besuretosavebackup copiesofyourprogramsomewheresafe.Otherwise,youmayendupretypingyour wholeprogramifsomethinggoeswrong. 4.Testing: Testyourprogramwithdifferentrandomnumbergeneratorseedsuntilyouget someimagesthatlookfun/interesting.Takeascreenshotoftheseimagesto includeinyourprojectreport.Youmayalsowanttoshowsomebad/uglyimages thatillustratewhathappensifthereisaproblemsomewhere(e.g.toomanylines, linestooshort,etc.).Youcandiscusshowyoucorrectedtheseproblemsinyour projectreport. 5.Documentation: WhenyouhavecompletedyourC++program,writeashortreportusingtheproject reporttemplatedescribingwhattheobjectiveswere,whatyoudid,andthestatusof theprogram.Besuretoincludeseveraloutputimages.Finally,describeanyknown problemsand/oryourideasonhowtoimproveyourprogram.Savethisreporttobe submittedelectronicallyviaBlackboard. 6.ProjectSubmission: Inthisclass,wewillbeusingelectronicprojectsubmissiontomakesurethatall studentshandtheirprogrammingprojectsandlabsontime,andtoperform automaticplagiarismanalysisofallprogramsthataresubmitted.Whenyouhave completedthetasksabovegotoBlackboardtouploadyourdocumentation(asingle docxorpdffile),andallofyourC++programfiles.DoNOTuploadanexecutable versionofyourprogram. 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 DayJan 30, 2021

Answer To: Microsoft Word - project1.docx CSCE4813–ProgrammingProject#1 DueDate–01/31/2020at11:59pm...

Avnish answered on Feb 06 2021
154 Votes
output.txt
set_color 1.0 1.0 1.0
draw_line 1 -9.411765 10.588235 10.588235 -9.411765
draw_line 1 -9.588235 -
7.411765 10.588235 -7.411765
draw_line 1 -9.588235 -5.411765 10.588235 -5.411765
draw_line 1 -9.588235 -3.411765 10.588235 -3.411765
draw_line 1 -9.588235 -1.411765 10.588235 -1.411765
draw_line 1 -9.588235 0.588235 10.588235 0.588235
draw_line 1 -9.588235 2.588235 10.588235 2.588235
draw_line 1 -9.588235 4.588235 10.588235 4.588235
draw_line 1 -9.588235 6.588235 10.588235 6.588235
draw_line 1 -9.588235 8.588235 10.588235 8.588235
set_color 1.0 0 0
draw_polygon 4 -8.411765 -7.411765 -3.411765 -5.411765 -3.411765 -9.411765 -8.411765 -9.411765
set_color 1.0 0 0
draw_polygon 4 -3.411765 -5.411765 -1.411765 -4.411765 -1.411765 -9.411765 -3.411765 -9.411765
set_color 1.0 0 0
draw_polygon 4 -1.411765 -4.411765 -0.411765 -1.411765 -0.411765 -9.411765 -1.411765 -9.411765
set_color 1.0 0 0
draw_polygon 4 -0.411765 -1.411765 5.588235 2.588235 5.588235 -9.411765 -0.411765 -9.411765
set_color 1.0 0 0
draw_polygon 4 5.588235 2.588235 6.588235 8.588235 6.588235 -9.411765 5.588235...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here