Research on the key technologies and realization of virtual campus

Virtual campus is a foundation of digital campus construction and its research and creation has great significance to digital campus. Building the scene with 3DMax and Photoshop and taking C# as the programming tools of Unity, we implemented the interactive virtual campus system and research on the key technologies involved in the system, such as model Optimization technology, virtual interactive technology, collision detection technology and particle effect technology and so on. The system operates stably and the image is smooth, which proves the point that Unity is an efficient tool for developing VR project.


Introduction
Virtual Reality, VR for short [1], generates a 3D virtual world by computer and allows users to simulate sensory experiences such as sight, hearing and touch and so on. With the development of society, VR is widely used in the fields of education, building, industrial simulation, medical industry, military, entertainment and game industry and so on [2].
Virtual campus simulates the environment conditions of the campus. Using 3D modeling technology, we create the models of the teaching building, library, canteen, dormitory building, stadium, campus road, square, garden and trees and so on [3]. Basing on VR technology and Combining with the interactive scripts, we make our user do the same actions as in the real world and it represents artistry and reality of the environment [4]. Virtual campus can enhance the popularity of college, promote campus culture, help the campus planning such as the buildings, roads and other supporting facilities, check thoroughly the future campus environment and set a clear goal for campus design.
Unity developed by Unity Technologies Company is a multi-platform integrated game development tool and professional game engine because it is easy to create interactive contents such as 3D video games, visual architecture and real-time interactive animation and so on [5]. Unity has interactive visual developing environment and its editor operate on the platform of Windows or Mac OS. Unity can release games to the platforms such as Windows, Mac, Wii, iPhone, Web GL and Android etc. It can utilize the plug-ins to release web games which support internet explorer on Mac or Windows. The paper takes advantages of great functionality offered by Unity engine, applies it to develop the virtual campus and researches the key technologies involved in the system.

Development process of system
The development project for virtual campus follows the common processes, including analyzing, designing, developing, testing, changing and repeating the above steps [6], which can implement progressively planned functionality of the system. Our development project for virtual campus includes nine steps: measuring real environment, sketching, creating models, collecting materials, attaching textures on 3D-model, importing models, editing scripts, recording video files and texting full environment. And the development process is shown as in figure 1.  Firstly we measure the real environment and sketch the campus with the same ratio. Utilizing 3DMax , we create the models of terrain, architecture and environment and work hard to guarantee the same ratio as buildings. According to the features of the appearance of real environment, we attach textures on 3D model with lifelike materials and make the virtual environment like true world. Lastly we import the models to Unity engine, edit the interactive scripts, connect the static environment to Unity engine and implement the interaction between characters and scenes.

Design objectives of system
The aim of design of virtual campus is to provide the users to as real as possible campus simulation environment and implement the interaction between characters and scenes.
1. Virtual campus has features of fine interface and easy to operate for users through browsers.
2. The main buildings are 360-degree and precise panoramic models. The user can amplify, reduce and rotate the building models via mouse.
3. There are two ways of free roam and automatic roam for roaming in the campus. The former is any user can casually browse in the campus. And then the latter is any user can browse by fixed route in the campus.
4. 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.
5. Comprehensive query. It can query any desired location and then locate it fast.

Implementation of system
The user can enable access to virtual campus through the Web page, experience virtual environment as possible as real, choose different functionality such as free roam, automatic roam and map navigation. During the process of roaming, the user can interact with the virtual environment, learn about the information in detail. The user can roam automatically by fixed routes and visit the campus. The result of scene test is shown as in figure 2 and figure 3.

Optimizing models
Model is the foundation of the virtual campus and its quality directly influences the simulation effect of the system [7]. Many complex models can add the system's burden and have an effect on interactivity and real time of the system. In the precise of simulation effect, we use standard geometry entities whenever possible when we create the model. There needn't be separate modeling but to be texture mapping instead of complex model for the details of building surface such as balcony, windows, trees, flowers and vegetation and so on. We use other ways to optimize the model such as deleting invisible surface, reducing the material and compressing the texture etc [8].

Collision detection
Collision detection is an essential mechanism for 3D interactive scene. The collision detection of Unity engine has two types, Trigger and Collision. Under the Trigger mechanism, there isn't any physical phenomenon when collision happens, which is applied to detect collision without any physical phenomenon. But instead, under the Collision, there are associated physical phenomena such as changing the position of the object and exploding the object. We apply Trigger to change the scene and open or close the door automatically. We use Collision to detect the collisions between characters, trees and building or each other when roaming.

Virtual interaction
On the platform of Unity, editing the interactive scripts is the core of virtual interaction. The scripts are given to static 3D models and interacted with the users [9]. The virtual interaction in the system mainly includes roaming freely, roaming automatically and information interaction.

Roaming automatically.
When roaming automatically, the user can visit and browse through the first person perspective by fixed routes and change his observation perspective via a mouse. The functionality of roaming automatically is implemented and shown in the following steps.
1. We create several cube objects as the navigation points of roaming automatically which is named WandarPoint. We create tags named WandarPoint to identify the navigation points, disable the mesh render components and delete the box collider components. We set evenly the navigation points to roaming paths, ensure that there is the navigation point at each intersection and there is no obstacle by any adjacent navigation point to reach through straight lines.
2. We edit the roaming automatically scripts, assign the script to the fixed object. The scripts includes two parts of operation. The first is to save all navigation points in the path of roaming, rank in order from near to far distance and locate the starting position and movement direction. And the second is to roam by the order of navigation points and reach the end points. We implement the first operation in the Start method of the scripts as shown in follows. path = GameObject. 3.3.3. Information interaction. Using the interactive system, the users can query conveniently and quickly the relevant information when the user is roaming. We utilize the 3D acquisition technology to implement the information interaction, for example there is a popup sub-form which introduces the relevant information of teaching building in forms of video, audio and text when the user can click the teaching building. The idea of 3D acquisition technology is very simple, which means that the ray located from the camera to clicking position by mouse emit to 3D world and intersect the first object that is the selected one. Some codes for querying the information of library are shown in follows. Ray ray = Camera.mainCamera.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit, 100)){ if (hit.transform.gameObject.name == "Library") { ……// event handling}}

Particle effect
Unity engine provides a simple and effective particle system which is applied to simulate easily phenomenon such as rain, snow, waves, flame, fireworks, smoke and its effect is much like that of the real [10]. The particle system of Unity engine firstly loads the resource of particle system, and then sets the parameters of particle system in the property panel as follows: duration=3.0f;Start Delay=0;Start Lifetime=0.1;Start Speed=0;Start Size=0.1;StartRotation=0;Max Particles=500. We put the particle system to specific object in order to prompt the user its interactivity.

Conclusions
Using 3DMax and Photoshop as modeling tool, we develop interactive virtual campus on Unity platform. Utilizing multi-platform deployment functionality of Unity, we release it to Web. From figure 3, the system provides virtual environment as possible as real to the user. The paper discusses and implements several key technologies involved in the development of virtual campus on Unity and these technologies can be applied to other VR and simulation fields such as electronics, safeguard and medicine and so on.