ANewMethodofVirtualRealityBasedonUnity3DSaWang1,2*,ZhengliMao2,ChanghaiZeng2,HuiliGong1,ShanshanLi1,BeibeiChen11TheKeyLabofResourceEnvironmentandGIS,CapitalNormalUniversity,Beijing,China2DepartmentofSurveyingandUrbanSpatialInformation,HenanUniversityofUrbanConstruction,Pingdingshan,China*Correspondingauthor:cccwangsa@163.comAbstract—Intheareaofgeographicinformationsystem,therearealwaystwomethodstoget3Dvirtualreality,oneistousea2DprofessionalplatformsuchasArcGISsoftwaretogetthevirtualrealitybysecondarydevelopment,theotheristousea3Dor2.5Dsoftwareasaplatformfordevelopment,suchastheSkylinesoftware.Inthispaper,wewilluseadifferentplatform,Unity3D,whichisusuallytreatedasgamedevelopmentsoftware,asavirtualrealitydevelopmentplatform.Firstly,thehierarchicalapproachofgeographicinformationsystemisadoptedinthestudyarea,andtheareaisdividedintofourlayers:TerrainLayer,BuildingLayer,TransportLayer,VegetationLayer,additionally,therawdataofTerrainLayerisobtainedbyGPSmeasurements.Secondly,allthegeographicalentitieswhichrelatedtodifferentlayersareconvertedto3DmodelbyAutoCADand3dsMaxsoftware.Thirdly,the3DmodelsareimportedintotheUnity3D,andprogrammingwithJavascriptlanguageinVisualProgrammingLanguageEditorinordertoachieveGameobjectsandScenes.Lastly,theScenesareintegratedandpublishedonthenetwork.TheattributedataofstudyareaisstoredbyMySQLwhichisconnectedwithUnitygameplatformbyexternalinterface.VisitorscandownloadtheActiveXcontroltobrowsethestudyarea,thesceneiskeeponupdating60timespersecond,theviewerwillsubconsciouslyinputandimmediatelyimmersedinthevirtualsceneforspontaneousexplorationandobservation.Withafullrangeofpersonalizedmodeofoperation,theuserscanchoosetheirownwaytobrowseandparticipateinthevirtualreality,andgivefullplaytotheirimaginationaccordingtotheirownwisheswithoutaffectingtheothersbyusingthedesignatedkeysonthekeyboard.Keywords-VirtualReality;Unity3D;GISI.INTRODUCTIONVirtualreality(VR)isatechnologywhichallowsausertointeractwithacomputer-simulatedenvironment,MichaelHeim(1994)identifiessevendifferentconceptsofvirtualreality[1]:simulation,interaction,artificiality,immersion,telepresence,full-bodyimmersion,andnetworkcommunication.Nowvirtualrealityiswidelyusedinindustryandpublicservicewithitsintuitivevisualandsimpleoperation.Unity3Disoneofthemostfamousvirtualrealitytools,itiscross-platformgamedevelopmentsoftware,andnowbesidesMacOSX,Unity3DcanfullysupportWindowsXP/Vista/7,Unity3Dsupportsthreescriptinglanguages:JavaScript,C#,andadialectofPythoncalledBoo.Allthreeareequallyfastandinteroperate,andcanusetheunderlying.NETlibrarieswhichsupportdatabases,regularexpressions,XML,fileaccessandnetworking.Scriptingisfrequentlythoughtofaslimitedandslow,butinUnity3DscriptsarecompiledtonativecodeandrunnearlyasfastasC++.Itiseasytogetthefastiterationtimesandeaseofuseforsomeonewholikesscriptinglanguages.Thesethreelanguagesingamedevelopmentprojectscanalsobemixed-use.Unity3dalsosupportstheWindowsplatform,C#,VB.net,VB6,Delphiandotherprogramminglanguages.TheUnity3DgameengineandtheUnity3Ddevelopmentenvironmentaretightintegrated,soitprovidesaverypowerfulvisualeditorandlanguagelevelsofthenetwork.Inthisresearch,weuseUnity3Dasthedevelopmentplatformforvirtualreality.ThestudyareaisthecampusofHenanInstituteofUrbanConstruction,Pingdingshan,China,withanareaof1,066,667m2,rangingfrom33°46′11″Nto33°46′42″N,113°10′52″Eto113°11′36″E.II.FRAMEWORKANDIMPLEMENTATIONA.FrameworkBrowser-Serverthree-tierarchitectureVR-basedframeworkisdesignedintheresearchareaandincluding3layers:presentationlayer,logiclayeranddatalayer[2].1)Presentationlayerismainlyusedforinterfacedisplayandtoachievetheuser'squery.2)Logiclayerconsistsofwebserverandapplicationserver[3].WorkflowofLogiclayerisasfollows:a)Webserverreceivestheuser’sHttprequestwhichsendbythebrowser;b)requestispassedtotheapplicationserver;c)applicationserverconverttheHttprequestsintothestatementthatdatabasecanidentify;d)sendingtherequesttoqueryinthedatabase;e)Whenthequeryiscomplete,thequeryresultsetsarereturnedtotheapplicationserver;f)applicationserveranalyzeandprocesstheresultsets;g)senttheresulttowebbrowserbywebservers;h)downloadthethree-dimensionalscenefilesthatuserrequestsfromPresentationlayer;i)showavirtualthree-dimensionalscenebyaplug-inwhichembeddedinthebrowser.3)Datalayerincludestherelatedspatialdataandattributedata,suchasDEMdata.B.ImplementationInthisstudy,thehierarchicalapproachofgeographicinformationsystemisadopted,andthestudyareaisdividedintofourlayers:Terrainlayer,Buildinglayer,TransportlayerandVegetationlayer.Figure1showsthedetailsofthelayersinstudyarea.Figure1.ThedetailsofthelayersinstudyareaInthevirtualrealitysystem,Two-dimensionalmapsareusedasbasemapsin3Dscenestoexpressthegeographicentity’sthree-dimensionallocationinformation.3DsMaxandothersoftwareareusedtocreatethree-dimensionalmodelsoffeaturesinthestudyarea.Three-dimensionalmodelsneedtoaddtextureandattributeinformation.Textureswhichcollectedthroughoutdoorjobscantrulyreflectthesurfacefeaturesofgeographicentities.AfterprocessingbytoolssuchasPhotoshop,texturesareimpor