Virtual Campus based on Unity3D
发布时间:2018-04-22 18:47
Keywords: virtual system of navigating; virtual campus; Unity3D; game engine
Abstract. Virtual Campus is the important part of the university digitization and information construction. The prototype system is established via a case study of the City institute campus, the Dalian University of Technology. 3DMax is adopted as the scene modeling tool and Unity3D is used to be the development tool in the paper. 3D virtual campus based on Web is designed and developed. The virtual campus enables the users to navigate the 3D virtual space, to guide and browse, and to inquire conveniently about relevant campus information at full length. The system runs well and maintain expediently, which means Unity3D is an effective tool for designing and developing a virtual reality platform.
As a game engine including graphics, sounds and physical function, Unity3D supplies a strong level editor, supports most of the mainstream of 3D software formats, taking C# and JavaScript as the programming languages to implement the script function and enables the developers to develop quickly the game products with high-performance and high-quality without any ideas of bottomed and complex technologies. As a 3D inter-platform game engine, Unity3D supports the mainstream platforms such as PC, Mac, Linux, Web, IOS, Android, Xbox360 and PS3[3]. There have been the development and testing on the PC platform and then the game will be transplanted on the other platform with few changes.
All rights reserved. No part of contents of this paper may be reproduced or transmitted in any form or by any means without the written permission of Trans Tech Publications, (ID: 136.186.1.81, Swinburne University, Hawthorn, Australia-17/05/15,07:27:28)
Abstract. Virtual Campus is the important part of the university digitization and information construction. The prototype system is established via a case study of the City institute campus, the Dalian University of Technology. 3DMax is adopted as the scene modeling tool and Unity3D is used to be the development tool in the paper. 3D virtual campus based on Web is designed and developed. The virtual campus enables the users to navigate the 3D virtual space, to guide and browse, and to inquire conveniently about relevant campus information at full length. The system runs well and maintain expediently, which means Unity3D is an effective tool for designing and developing a virtual reality platform.
Introduction
The improvements in computer technology have also been matched by rapid campus information construction and virtual campus is the important constituent one of them[1]. Traditionally, the virtual campus established on the base of the 2D plane map and photo map cannot meet the diversified needs for instance, recruiting students and giving publicity to the external, navigating in campus and conducting the information management[2]. 3D virtual campus based on the virtual reality and network techniques has much more advantages in immediacy, real scenes and good interactive experience and enables the users to enjoy their immersive experience. 3D virtual campus has become a fundamental column of campus websites and it would play a major role in giving publicity to the external, recruiting students and conducting the information management. The prototype system is established via a case study of the City institute campus, the Dalian University of Technology. 3DMax is adopted as the scene modeling tool and Unity3D is used to be the development tool in the paper. 3D virtual campus based on Web is designed and developed. The key techniques such as 3D scene modeling, roaming and interacting with each other are discussed further.As a game engine including graphics, sounds and physical function, Unity3D supplies a strong level editor, supports most of the mainstream of 3D software formats, taking C# and JavaScript as the programming languages to implement the script function and enables the developers to develop quickly the game products with high-performance and high-quality without any ideas of bottomed and complex technologies. As a 3D inter-platform game engine, Unity3D supports the mainstream platforms such as PC, Mac, Linux, Web, IOS, Android, Xbox360 and PS3[3]. There have been the development and testing on the PC platform and then the game will be transplanted on the other platform with few changes.
The development process and design of the virtual campus
The development process of the virtual campus. The development of the virtual campus follows the general principle that includes successively analyzing, designing, developing, testing, revising tautologically and completing gradually the program[4].The process of system development has two prongs. The first part is that three-dimensional model of campus scenes is built. According to campus architectures and environments the model is constructed and optimized by 3DMax. Then the second step achieves the interactive experience between the users and environment. The main contents are to script interactive scenes which are applied on connecting the static three-dimensional model to Unity3D and enable the model to have the interactive experience.All rights reserved. No part of contents of this paper may be reproduced or transmitted in any form or by any means without the written permission of Trans Tech Publications, (ID: 136.186.1.81, Swinburne University, Hawthorn, Australia-17/05/15,07:27:28)
The design of the virtual campus. The design aim is to supply the users with as vivid as possible emulation environment and to realize to interact with each other between the users and environment. The design of the virtual campus is as follow.
The users can visit and browse online. In order to adapt different network environment and hardware and software equipment, the emulation scene cannot be too large. The campus is divided into six scenes and there are seamless connections between the scenes in the paper.
There is three-dimensional exhibition function in the campus. There is built the main scenes such as teaching building, gym, library and dormitory building in the virtual campus and as vivid as possible delicate model.
There is navigating function. The visitor can browse as one pleases with keyboard and mouse and directly reach to the designated area by the navigation menu.
There is multimedia exhibition function. The scenes are embedded Flash, Video, audio and text etc. And after reaching to the designated area, the visitors can choose the contents from the requests. All convey a stronger sense of immediacy and more dramatic three-dimensional exhibition.
Setup of the planform and navigation chart will be convenient for the users to know the campus.
Implementation of the Virtual Campus
Construct the model. The virtual campus is based on the model which can impact directly the simulation effect. The campus models include the surface models, building models and environment models. According to the contour map, the surface models are constructed. Above of all, CAD is used to preprocess it and 3DMax is introduced to create the surface models including scalene triangle flat surface. The building models are created by the elevation of plans and the buildings. The elevations are introduced to 3DMax and the accurate three-dimensional building models are created. The details of the building surface such as terraces, doors and windows and fences haven’t been modeling alone and the way of texture mapping is used and texture pictures replace the complicated model structures. The environment models include trees, flowers and grasses and plants. There are a lot of trees which haven’t been modeling and the mode of billboard is adopted in order to reduce the complexity of the scenes in the campus scene. The optimization of the model is taken into consideration in the process of modeling and the optimized methods such as deletinginvisible sides, reducing texture quantities and compressing the chartlets are used to simplify the models and a decrease in the size of models [5].
Design the scenes. If the scene has contained overmuch models, the loading time and implementing time will be increasing and leading to wait for the longest time when the users operates. In order to improve the circumstance, multi-scenario is adopted in the system. The campus is divided into many fully independent sub-scenes which are modeling alone. The partition of the campus decreases in number of the models, reduces the complexity and heighten the rendering speed in the sub-scene. The sub-scene which the user hopes to navigate is loaded and all the campus information needn’t be loaded. It can reduce the loading time of system that fits to visit online in multi-scenario. The campus is divided into six sub scenes including gate, teaching building, laboratory building, library, gym, stadium, dormitory areaNo1, canteen and dormitory areaNo2.
1858 Modern Technologies in Materials, Mechanics and Intelligent Systems
Navigate in the campus. Navigating function is a main one of the virtual campus. The system supports the users to visit and browse in the first person. The user can move with the assistance of the mouse and keyboard. Up arrow key, Down arrow key, left key and right key control respectively forward, rearward ,left and right movement. The mouse is used to change the direction. The implementation steps of navigating function in the campus are shown as follow.
Step1. Creating the virtual person. The person model is introduced and named after Player. A camera is created and put to the head of the player and set up for a sub-object of the player. The environmental angle which has been switched to the camera happens in the first person. The subassembly of the capsule collider is added for the player to experience the perception and simulation about the collision. For example, there is a stop after collision with the wall and the size of the capsule is regulated and a good match for packing the player. The rigid body subassembly is added for the player. The movement of the player is in keeping with the physics rules. After the player jumps, he will not fly towards the sky and fall again to the ground, for example.
Step2.Control the movement of the virtual person. In order that the virtual person can move, the PlayerMove script need to be created and is designated for the players. The code of onward movement is exemplified as follow.
void Update(){ if(Input.GetKey(KeyCode.UpArrow)){
movev-=Speed*Time.deltaTime; transform.Translate(new Vector3(0,0,movev);
}}
Step3.Instantiating the virtual person. When navigating in each scene the virtual person must be used. The prefab of the player is created and named after PlayerPrefab. The virtual person is instantiated by editing the InstantiatePlayer script with the aid of the PlayerPrefab and the script is designated to null object of each scene. By the way of example the code of the virtual person is exemplified as follow.
void Start(){
Player=Instantiate(Playerfab,pos.position,pos.rotation);
}
Interactively link the scenes. The virtual campus consists of six scenes and the users can freely choose to navigate the scenes with the aid of interactively linking between the scenes. The system supports linking the scenes in two ways. One, when the user get to the particular location in the scene, the linking between the scenes is implemented by touching off collision events. Two, the user is linked by navigation menu to the designated scene. The method of the linking between the scenes implemented by touching off collision events is introduced in the paper. Its steps are in detail as follow.
Step1.The Cube object is created. Its location and size is adjusted just to consist of certain extensional area in the scene. Supposing the attribute of Is Trigger of the Box Collider subassembly of the Cube to be true, Mesh Renderer subassembly of the Cube is deleted and the object is named after the scene name corresponding to the extensional area.
Step2.The script of linking the scenes is edited and added to the Cube object. By the way of example the code of linking the scenes is as follow.
void OnTriggerEnter(Collider other){ if(other.name==”Player”){
Application.LoadLevel(transform.name);
}}
Step3.The above operation is carried out again until the cube objects corresponding to every extensional area are created in the scenes.
Interacting with each other between the information. The user can query the relational information of the parts of the campus conveniently and quickly by interacting with each other between the information in the process of navigating. The system supports interacting between the information in two ways. One, the interacting is implemented by clicking the object. For example, when the user clicks on the bulletin board, the sub-window for browsing will pop up and the latest bulletin and timetable etc. are queried. Two, the interacting is implemented by touching off the collision events. For instance, when the user arrive at the gate of the library, the prompt menu will pop up. The user can query the information such as history, architectural layout and the collections of the library etc. by video, audio or text introduction. The interactive process of collision is analogous to that of linking the scene. The interactive implementation way by clicking is mainly introduced in the paper. 3D pickup technique is applied on the interactive way by clicking. It means the ray determined by the camera and the clicking position of the screen falls into the world space and crosses the first object which is chosen. By the way of example the partial codes of querying the information of the bulletin are as follow.
void Update(){
Ray ray = Camera.mainCamera.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit, 100)){
if (hit.transform.gameObject.name == "Board") {
……
}}}
Conclusion
Virtual reality technology is applied on the digital campus development in the paper. The method of the multi-scenario modeling is adopted and 3DMax is used to construct the three-dimensional campus model of City institute campus, the Dalian University of Technology. By the aid of the game engine of Unity3D, navigating in the campus, interactively linking the scenes and interacting with each other between the information are implemented. Finally, the arrangement function of the Unity3D multi-platform is given play to release to web platform. The user can navigate in computer on the network and feel the personal and immersive experience from the campus panorama, all sorts of facilities and services, etc. The development of the system has proved that Unity3D is an effective development tool of designing and developing the virtual reality platform.References
[1] Zhu Huijuan. Virtual Roaming System Based on Unity3D[J].Computer Systems and Applications.2012(10)36-38[2] Ou Yangpan,Li Qiang,Lu Xiuhui.Research and implementation of virtual campus development based on Unity3d[J]. Modem Electronics Technique.2013(4)19-22
[3] Jeff W,Murray. Game Development for IOS with Unity3d.2012
本文编号:1788478
本文链接:https://www.wllwen.com/kejilunwen/jisuanjikexuelunwen/1788478.html