Research on Optimization Algorithm of Virtual Campus Roaming System

Research on Optimization Algorithm of Virtual Campus Roaming System

Virtual reality (virtual reality, VR) is a computer system that can create and experience a virtual world. It refers to the use of high-performance computers to generate realistic virtual environments such as realistic sight, hearing, touch, smell, etc. Devices (such as data gloves and helmets) interact in real time with virtual objects in the virtual environment in a natural way, interacting and interacting with each other, thereby creating a sense of immersion.

In recent years, with the accelerated development of computer hardware technology, the application of virtual reality technology in real-time roaming in the built environment has become a hot topic of concern. Virtual campus roaming is one of the basic functions of urban planning applications. To construct a virtual campus roaming system, it is necessary to comprehensively apply the latest computer technology, computer graphics technology, multimedia technology, sensor technology, display technology and network technology. According to the planning and design of the Second Artillery Sergeant's School, the virtual reality technology was used to develop a "virtual campus real-time roaming system" based on a desktop system. The system uses mid-range PCs as a hardware platform and carries out in-depth optimization algorithms for real-time roaming systems the study.

1 Overall system structure

In order to ensure that the entire scene can run smoothly and smoothly on ordinary high-end microcomputers, and at the same time achieve the function of real-time roaming to ensure its safe and reliable operation, according to the focus of the task, the entire system can be decomposed into a scene model subsystem, roaming The engine subsystem, input subsystem, rendering output subsystem, etc. are relatively independent in function, and are connected with each other through the data interface. The overall structure is shown in Figure 1.

2 Optimization of models and textures

2.1 Optimization of 3D complex model structure

There are many complex structural models in the virtual campus. If the number of polygons in the model database exceeds the computing power of the system, the frame processing will not be completed in time when roaming in the virtual scene, and the smoothness of the scene change will be destroyed. In order to improve the real-time performance of the running system, the model must be simplified to reduce the polygon cost of the database, and the model should be simplified from the following aspects:

1) Use LOD to express complex structural models. There are many complex models in the virtual campus that must be expressed by LOD, so that the number of polygons in the running system is controlled within the budget, which is conducive to improving the real-time performance of the running system.

2) Use texture instead of polygon to express structural details. Texture mapping can improve the detail of the scene expression without increasing the number of polygons. Using the LOD model with a certain level of detail to replace the polygon model will greatly reduce the drawing load of the system.

3) Delete redundant polygons. Deleting redundant polygons in the database can reduce the number of polygons in the system to some extent. These polygons may be the internal details of the model. The back of some polygons may be the bottom of the model on a certain plane. The bottom of the house to be roamed, etc. It can be simplified by the OpTImize decorator in 3DSMAX, which is mainly used to reduce the number of faces of the model. It is worth noting that OpTImize must be done before the texture, otherwise the texture will be distorted.

4) Remove the back of the polygon. The polygons that make up most of the models in the virtual campus environment are visible on one side. 3DSMAX can automatically remove the back of the polygon and display only the front. The vast majority of polygons in the virtual campus environment except the tree model are visible on one side. of. In order to reduce the operating load of the system and increase the rendering speed, if the polygon is visible on one side, it should be ensured that its state is not set to 2side.

2.2 Optimization of texture mapping

The texture used in the virtual campus is defined discretely by digital images obtained by shooting the surface details of the scene with a digital camera, and then 3 DSMAX texture tools are used for texture mapping and texture editing; however, the size, number and resolution of textures in the system The rate is limited by the texture storage space in the running system. Therefore, in order to minimize the system resources (such as storage space) occupied by textures without reducing the authenticity of the simulation, texture data must be optimized to improve the real-time performance of the system.

Optimize the texture data from the following aspects:

1) Reasonable determination of texture size. The size of the texture should be reasonably determined according to the performance of the graphics accelerator card, the memory of the running system, and human visual physiological characteristics. In order to effectively save memory, the textures used in the virtual campus are mostly 512 × 512 or smaller. High-resolution textures are only used when the virtual scene needs to be viewed at close range.

2) Optimized configuration of texture internal format resolution. The internal format resolution of the texture determines how to change the byte configuration of each color component of the texture data, so as to obtain different effects of different format textures on aspects such as performance, efficiency or image quality. The texture data in the virtual campus has been optimized as follows: In order to save memory, the internal format of most RGB files with better source data collection effects is allocated to TX—RGB-5, and the internal format of RGBA files is allocated to TX—RGBA-4 ; Some texture data is not ideal because of the collection effect, in order to ensure image quality, its internal format is set to TX-RGB-12.

3) Application of sub-texture. The texture details of some surfaces in the virtual campus are less different, such as the pavement texture of different road sections. The use of sub-textures not only avoids obvious similarities, but also saves memory. [

3 Optimization of the roaming engine subsystem

3.1 Establish a good hierarchy library

Since each part of the established model corresponds to a panel in the hierarchy diagram, the real-time roaming system will display the database composition through a hierarchy diagram. An orderly and organized hierarchy diagram will make your model in the real-time roaming system. Show it at the fastest speed and in the most correct way. Hierarchical structure library is also a visual data structure library. This structure is like an inverted tree with roots at the top and branches and leaves below. It will show the structure of the model, and the various components are arranged in one or more tree structures in the form of small panels, which is very conducive to the modification of the model. Edit any face by clicking and dragging the small panel with the mouse in the hierarchy diagram. For example, click to edit any model structure in the view, and double-click to get or modify the properties of the structure. And because the faces are arranged in the order from left to right when they are in the group or in the solid, if some of them are arranged in the wrong order, you can move the panel to the left or right to adjust their order. When displaying, for any point, Z-buffer will calculate the distance from all objects near this point to the screen, and the color of the closest object will be assigned to this point, thus preventing the need to convert or sort the faces when creating the faces. In addition, a good hierarchical structure library can be more conveniently used for scene selection. In other words, this virtual scene structure can choose which part of the scene can be seen according to the current viewpoint. At the beginning of rendering, invisible geometric elements are not processed, thereby enhancing the performance of the rendering stage of the virtual reality scene.

3.2 Stereoscopic display technology

Stereoscopic display is very important for realizing the immersion of virtual reality. The image of stereoscopic display can be observed through helmets, liquid crystal light valve glasses, etc. The stereo vision model requires two viewpoints to be calculated separately to generate left-eye and right-eye views. At this time, two projection centers are needed. According to the relative positions between the projection surface, the human eye and the observed object, there can be a difference between negative parallax and positive parallax. Taking negative parallax as an example, the following derivation calculation is performed based on the perspective principle: set the distance between 2 eyes to 2 half-eye, if the midpoint of the line segment between is defined as the origin of the coordinate system, the line segment is located on the middle axis The projection plane is vertical, and a three-dimensional coordinate system is established using the right-hand system. The coordinates of the 2 eyes are (half-eye, 0, 0) and (a half-eye, 0, 0), and let the object point coordinates be , The distance of the object from the viewpoint is 0distance, the distance of the projection plane from the viewpoint is . Looking at the projection point of the object from two eyes, the coordinates of the projection point of the object on the projection plane are: among them In order to facilitate the calculation of the coordinates of the projection point, the position of the right eye is used as the origin of the coordinates, which can be obtained by calculation

The same reason can be obtained, Y. When calculating the left picture, r is a positive value; when calculating the right picture, rhalf-eye is a negative value. After the stereo image pair is generated, each eye can only see one image in the stereo image pair when observing with a helmet or stereo glasses, so as to give people a stereoscopic feeling.

3.3 Texture mapping technology

Texture mapping technology is one of the fastest-growing technologies in recent years, and is widely used in the generation and display of three-dimensional realistic graphics ... J. The use of texture mapping makes it easy to produce photorealistic graphics without spending more time to consider the surface details of the object. The essence of texture mapping is to perform two-dimensional parameterization of a three-dimensional object, that is, first find the two-dimensional of any point on the surface of the three-dimensional object Parameter value, and then get the texture value of the point, and finally generate the texture pattern on the surface of the three-dimensional graphics. The core problem of adding texture patterns on smooth surfaces is mapping, so the texture problem can be simplified as a transformation from one coordinate system to another. At least two mappings are involved, one is from texture space to scene space, sometimes called surface parameterization; the second map is from scene space to image (screen) space, that is, viewfinder transformation. Usually, these two transformations are combined into one transformation. The following describes how to use texture mapping techniques when drawing three-dimensional scenes.

1) Big environment-sky box.

In the virtual campus, we must first build the big environment-the sky. In some three-dimensional modeling software such as 3D MAX or Maya, the sky box is usually used to express the sky scene, such as a sunny day, bright lights at night, etc. The model of the sky box You can use a hemisphere to express the sky environment by texture mapping the inner surface of the hemisphere. However, this model is prone to skewing at the two points of the sphere when mapping. To avoid this situation, use the cube (to grab the bottom) model to simulate the sky.

2) Drawing of realistic terrain.

Realistic terrain drawing is divided into two parts: terrain model mapping and realistic terrain generation. Terrain model mapping is to convert digital terrain data into the basic format of mulTIgen's vega system, and calculate related parameters (vertex and normal vector, etc.) )the process of. First convert the digital terrain model into vega primitives to generate a sequence of primitives recognizable by vega. Vega not only provides modeling primitives such as points, lines, and polygons, but also can represent terrain model data as typical through these primitives. Primitive sequence, linear primitive sequence and polygon primitive sequence. Because vega requires polygons to be convex polygons, the triangle model primitive sequence is used to express the terrain model in the software implementation. Since vega does not directly calculate the normal vector of each vertex, if you want to obtain better visual effects or simulate a special landscape, you need to calculate its normal method for each vertex when it is converted into a Vega triangle sequence Vectors; and the normal vectors of all vertices should be consistent, otherwise some triangles will not be visible. Taking the normal vector of each vertex as the average value of the normal vectors of all triangles surrounding the vertex, this can achieve the smoothing effect of the terrain. Photorealistic terrain refers to generating black-and-white or color images like photographs through perspective projection and blanking on the terrain to produce virtual effects. Through vega's texture mapping technology, the geomorphic picture is merged with the digital terrain to improve the expressiveness of the terrain.

4 Conclusion

At present, there are few reports on desktop-based real-time roaming systems abroad. Many mature products are basically panoramas and simple scenes. This system uses the desktop system to realize the real-time roaming of the virtual campus and the cost is low. The optimization algorithm adopted has the following advantages:

1) The texture mapping is optimized to reduce the amount of calculation in the real-time rendering process, and the effect is almost no loss.

2) The optimized virtual reality engine occupies very little memory, which provides a basis for implementing the virtual campus roaming system on the microcomputer. The example test proves that the algorithm can effectively transform the desktop virtual reality roaming engine to make it run on the ordinary desktop system. The effect after drawing not only retains the characteristics of the original model, but also meets the needs of real-time roaming.

Our company is specialized in supplying Vacuum Pump. A good quality vacuum pump is an integral tool for complete A/C service. Our vacuum pumps are durable and time tested. They stand up to the most grueling conditions and will provide years of reliable service. We offers a complete selection of pumps. Regradless of you service requirements, We have a model for your application.Our single stage vacuum design pulls vacuum fast to 20Pa. Adavanced two stage design pulls deep vacuum fast to 3Pa. Dual voltage design vacuum pump operations on 115VAC or 220VAC (50 or 60Hz).

Vacuum Pump

Vacuum Pump,Mini Vacuum Pump,Rotary Vane Vacuum Pump,Air Vacuum Pump

ZHEJIANG ICE LOONG ENVIRONMENTAL SCI-TECH CO.,LTD. , https://www.ice-loong.com