2018 International Conference on Sensor Network and Computer Engineering (ICSNCE 2018) 126 The Research and Implementation of 3D Scene Simulation of Camouflage Yu Jun School of computer science and engineering Xi'an Technological University Xi'an, 710021, ShanXi, China e-mail: yujun@xatu.edu.cn Li Zhonghua School of computer science and engineering Xi'an Technological University Xi'an, 710021, ShanXi, China e-mail: 761173763@qq.com Hu Zhiyi Engineering Design Institute Army Academy of PLA Beijing, 100000, China e-mail: huzhiyi016v7@163.com Dai Jun School of computer science and engineering Xi'an Technological University Xi'an, 710021, ShanXi, China e-mail: daijun24@qq.com Abstract—Aiming at the problems in the camouflage design of military engineering, such as strong subjectivity and unpredictable camouflage effect, etc. We propose a 3D camouflage scene simulation method based on MFC and Vega Prime technologies. On the basis of real DEM data in an area in American, we use 3D visualization technique to create terrain model and ground object model. The camouflage pattern is applied to the surface of the model by texture mapping technology, and real-time rendering is used. The engine Vega Prime API renders the model and creates a camouflage simulation scenario. The result shows that, the virtual scene of camouflage can be generated by using visual simulation technology, this helps to test the effect of the camouflage pattern. Keywords-Camouflage; Terrain Modeling; Visual Simulation; Digital Elevation Model I. INTRODUCTION Camouflage, as the most basic military camouflage technology, is one of the commonly used method to combat investigation and attack in modern warfare[1]. The commonly used method of Engineering camouflage is to paint camouflage patterns on the surface of the target with dope, however, the effect of this kind of camouflage is influenced by environmental. This usually requires personnel to participate in the evaluation of camouflage effects, so it may consume a lot of resources. Many scholars began to use the Vega prime-based(VP) visual simulation technology to build 3D model of military target or reproduce a realistic environment to achieve realistic simulation results. For example, Zhang[2] combines the development features of MFC application program, gives a 3D visual development method based on multi-process technology, and applies it to the development of a 3D scene of a portable air defense missile simulator software. Yao[3] using the virtual battlefield large terrain visualization features and focuses on the research of large-scale real terrain visualization techniques.Hu[4] made a further improvement on Zhang's foundation[2], he gives a program framework that seamlessly integrates VP under VC++'s MFC library programming environment, optimizing the structure of the system. However, none of the above methods can perform real-time simulation of real 3D space and do not have interactive capabilities, making these methods unsuitable for simulation of engineering camouflage. In response to these problems, this paper is based on the 3D visual simulation method[2-6] and real DEM data, combined with the actual engineering camouflage environment, establish the Vega Prime visual simulation framework based on MFC, design a real-time roaming system simulation of a camouflage scene. II. THE OVERALL DESIGN OF THE SIMULATION SYSTEM The camouflage 3D scene simulation system includes two parts: simulation model and simulation scene. The simulation model refers to all the models in the target area, and the simulation scene refers to the virtual camouflage simulation scene generated in order to achieve the effect of the engineering camouflage simulation. For engineering camouflage simulation system design and development can be divided into the following four steps to complete, and the overall system framework is shown in Figure 1. Terra Vista Creator Camouflage generate system terrain model Culture Data Surface layout Texture material DEM data ortho-photo data ground object model Camouflage pattern Vega Custom code API Real-time operation Real-time application Simulation scene of Engineering camouflage Figure 1. Framework of Simulation system A. Build terrain model Acquire high-precision DEM data and satellite ortho-photo data of a certain region and establish a terrain model of a simulation scene in Terra Vista to construct the altitude and fluctuation of the surface. B. Build ground object model According to the plane layout, texture material and other data of the ground surface around the simulation scene, the 2018 International Conference on Sensor Network and Computer Engineering (ICSNCE 2018) 127 ground model was constructed by MultiGen Creator, thereby constructing the scene of military equipment, weapons and equipment, and storage camps. C. Camouflage scene model According to the background and target characteristics around the simulation scene, Yu’s[7] camouflage design method was used to obtain the digital camouflage pattern, the camouflage pattern was mapped to the surface of the 3D model, and the disguised model was arranged in the whole scene. D. Rendering and implementation The OpenFlight API is used to programmatically export the layout information of the model, then uses Vega Prime and visual studio to write the real-time scheduling display program, and combines the MFC framework to generate a real-time roaming simulation scenario. III. ESTABLISH AND RENDERING MODEL A. The establishment of terrain model In the field of military camouflage, terrain refers to the natural state of the earth's surface. Whether a target can be detected or not depends on the complexity of the terrain and the difference between target and background[8]. Terrain model is an abstract and simplified expression of real terrain attributes. Therefore, it is inevitably involved in the display and processing of the 3D geospatial scenes in the battlefield environment simulation. The terrain visual simulation has become the hot spot of the 3D scene simulation research in the battlefield environment. Terra Vista is MultiGen's software for modeling complex terrain visual simulations and is used to build 3D terrain simulation models. Terra Vista manages 3D terrain data in a project. It is mainly composed of a terrain data source library, terrain parameter configuration, vector parameter configuration, CDB format terrain file browsing, and a model database. It runs on the Windows platform and generates a terrain database in MataFlight or OpenFlight format that can be used directly on PC workstations or other graphical vision systems. Terra Vista builds a 3D terrain simulation model mainly including three steps: data loading, setting terrain parameters, and calculating & generating terrain. 1) data loading It mainly includes the import of data such as elevation data, satellite image data, and vector data. First, load digital elevation data. Take a certain 60km2 area of America as a camouflage scene. The more accurate the DEM data is, the more realistic the terrain is, and the more detailed local details of the real terrain can be expressed. For simulation scenarios, the accuracy of the terrain grid is generally 10m to 30m. Therefore, Yu[9] proposed an improved bilinear interpolation algorithm to interpolate on the basis of the original DEM data, thereby improving the accuracy of DEM data. 30m accuracy of the original elevation map and Yu's method to 15m accuracy elevation map shown in Figure 2. (a)30m accuracy elevation map (b) 15m accuracy elevation map Figure 2. 30m and 15m accuracy elevation map Second, load satellite image data. Use Bing Maps Satellite to obtain satellite imagery of the area to be camouflaged. The image is a Mercator projection on a SPHERE RADIUS 6378137 benchmark, and the SRTM DEM uses a Geocentric projection of a WGS84 benchmark, So this requires format conversion. Use the Projection Conversion Tool in Global Mapper to convert satellite imagery into the WGS84 benchmark Geocentric projection format. The ortho-photos obtained are shown in Figure 3. Figure 3. Ortho-photos maps Finally, load vector data. The vector data refers to the polygons in the terrain database except terrain. It can be formed naturally, such as lakes and rivers, or it can be constructed artificially, such as buildings and roads. we use satellite image to create vector data for this area by Terra Vista. The main rules are: to create point details for objects with limited area, location, orientation, that do not require a specific shape; to create linear details for objects that length is much larger than the width and height; to create area details for objects that occupy a large area and need to be defined on the edge of the area. 2) Terrain parameter settings It mainly includes the levels of detail (LOD), the visual distance, the size of the grid, and the method of construct grid. Terrain LOD technology is a kind of terrain drawing method, which reduces the geometric complexity of the terrain scene by simplifying the details of the terrain surface step by step without affecting the visual effects of the scene, thereby improving the efficiency of the rendering algorithm. In this paper, the LOD is constructed using a quadtree hierarchy, each layer divides the terrain into several grids, the next layer quarters each grid in the previous layer, and so on. Each layer in the hierarchy Grid is subdivided by a number of triangles. The simulation scene LOD is set to 2018 International Conference on Sensor Network and Computer Engineering (ICSNCE 2018) 128 three levels, the visual distance is set to 5000m, the terrain block is set to 7500m×7500 m, and Denauley algorithm is used to construct a triangular mesh to generate multi-resolution geometric terrain. AS shown in Figure 4. (a) Terrain model with 582 patches (LOD2) (b) Terrain model with 8496 patches (LOD1) (c) Terrain model with 18,171 patches (LOD0) Figure 4. Terrain model with different resolutions 3) Calculate and generate terrain Use the Gaming Area tool to select the target area to be generated, set the format and resolution of the output texture image, determine the output model format, taking into account the later amendments in the Creator, this article uses OpenFlight format. In the process of generating the terrain model, the generated terrain is stored in the OpenFlight model file in the unit of divided grid. Finally, each model node is unified by an external reference node in the file named master.flt. Figure 5 is shown as the final geometric terrain. Figure 5. Terrain map B. Build ground object model The ground object model is an important part of the battlefield environment, including natural land objects, military equipment, blockhouses, storage barracks and other important battlefield objects. MultiGen Creator is a visual simulation software for creating 3D models. The basic core of the software is the modeling module, which provides a visual environment for creating and editing database files[10]. Different from common modeling tools such as 3DMAX and MAYA, Creator uses a hierarchical structure to describe the simulation scenario. It can conveniently organize the model according to the geometric feature and is suitable for real-time traversal operations[11]. Steps for using Creator modeling are as follows: Step1: Determine model data. For natural objects, information such as location and area is required; For buildings, they need information such as floor plan, section drawing, and three views. Step2: Determine the hierarchical structure of the model. Decompose the model according to the tree structure, such as the floor of the building, the inner wall, etc. Step3: Using Yu's algorithm[7] to generate camouflage pattern, the selected typical background and the generated camouflage pattern are shown in the following page Figure 6. (a) typical background (b) camouflage pattern Figure 6. The generation of camouflage patterns. Step4: Using texture mapping technology to Figure 6.camouflage pattern mapping to the surface of 3D model, through the interactive control module rotating object or change the point of view to get a different perspective, has practical application value of camouflage target 3D view. Finally, the 3D model is placed in the simulation scene according to the corresponding proportion. The ground object model is shown in Figure 7 and Figure 8. Figure 7. Helicopter camouflage model Figure 8. Tank camouflage model C. Rendering and implementation of the model Real-time rendering engine is the core of camouflage simulation scene. Vega Prime, a real-time 3D visual simulation tool developed by MultiGen, is widely used in 2018 International Conference on Sensor Network and Computer Engineering (ICSNCE 2018) 129 military simulation[12]. VP includes LynX Prime graphical user interface configuration tool and VSG advanced cross-platform scene rendering API[13]. This article calls VP in the environment of MFC library to implement the design of virtual real-time simulation system. The specific method is as follows: Step1: Creates a single thread in the application to run the whole VP program, include initialization, define, configure, and frame cycles. Step2: Adds the member function responsible for opening the thread in the view class of the MFC framework. Step3: Uses the API function AfxBegin Thread to open the VP thread, and continuously refresh the VP visual window in the background program. IV. SIMULATION RESULTS AND ANALYSIS. The developed engineering camouflage scene system based VP technology is shown in Figure 9 The system interface is mainly composed of 4 parts. Among them, part 1 is a subpanel which control to create model, including load OpenFlight formatted data of terrain and ground object model data, generates digital camouflage pattern, and implements the camouflage to terrain and object model in the simulation scene; Part 2 is a configuration subpanel of rendering, including setting the observer, moves mode and atmospheric environment in the simulation, and implements the control of simulation scene, such as translation, scaling, rotation, etc; Part 3 is a simulation control subpanel, and control the beginning and end of the roaming of the whole simulation scene; Part 4 is a display subpanel of simulation scene, show the full face of the scenario. The user can use the PC device to roam freely in the virtual scene. The system will perform real-time rendering and updating according to the position of the movement. The user can view the layout of the simulation scene from different perspectives and positions by switching from a close-range perspective to a distant perspective. Figure 9. Camouflage scene system interface As we have seen from Figure 9, the terrain model and object model established by this system are consistent with the feature of the regional target background. The simulated scene after the disguise has high fidelity and realistic feeling, which is not easy to be detected, which fully reflects the importance of visual simulation in camouflage. V. CONCLUSION In this paper, we have improved the traditional engineering camouflage method through 3D scene simulation technology. we build a framework of VP visual simulation based on MFC, to achieve the target area terrain and object modeling and rendering, establish a 3D, dynamic and high fidelity simulation scene of camouflage. The result shows that, the camouflage simulation scene designed in this paper visually and truly reproduces the effect of camouflage operations in the field, enhances the user's sense of immediacy, and solved the camouflage effect evaluation in current military engineering mainly depends on the field work. It provides an effective auxiliary measure for the evaluation of engineering camouflage effect and provides a good virtual simulation platform for the design of military engineering camouflage, at the same time, this helps to reduce resource consumption for camouflage evaluation. REFERENCES [1] Hu Jianghua. Camouflage technology[M]. Beijing, National Defence Industry Press, 2012: 84-88. [2] Zhang L, Han J Y, Zhang J, et al. Research of Program Development Technology of Vega Prime Based on MFC Framework[J]. Fire Control & Command Control, 2014, 03(39): 159-162. [3] Yao F F, Liang Q, Xu R J, et al. Study of three-dimensional virtual battlefield large terrain dynamically generated based on vega prime[J]. Journal of System Simulation, 2012, 24(9):1900-1904. [4] Zi-Nan H U, Jin-Song Y U. Research of Software Integrated Technology of Vega Prime Based on MFC Programming Framework[J]. Journal of System Simulation, 2009, 21(14):4291-4290. [5] Wu G, Tao J. 3D Modeling of the Relievo Based on the Computer Active Vision[C]// International Conference on Mechatronics, Computer and Education Informationization. 2016. [6] Liu P, Lu Z. Construction and Visualization of 3D Landscape[C]// International Conference on Computer Network, Electronic and Automation. IEEE Computer Society, 2017:28-32. [7] Yu Jun, Shuang Xiao. Design of Imitation Digital Camouflage[J]. Journal of Applied Sciences, 2012, 30(4):331-334. [8] Dong Zhiming, Guo Qisheng. Modeling and simulation of battlefield environment[M]. Beijing, National Defence Industry Press, 2013: 153-157. [9] Yu Jun, Lu Yanxin, Hu Zhiyi, et al. An Improved Bilinear Interpolation of Regular Grid DEM[J]. Journal of Geomatics Science and Technology, 2015, 32(5):521-524. [10] Shao Xiaodong. MultiGen Creator modeling art[M]. Xi`an, Xidian university press, 2014: 40-43. [11] Wang N, Han Y, Chen G. Comparison Analysis of Modeling of Virtual GIS Based on 3DS MAX and MultiGen Creator[J]. Bulletin of Surveying & Mapping, 2010, 62(5):14. [12] Vega Prime Programmer’s Guide(Version 2.0)[Z]. Dallas: MultiGen-Paradigm Inc. 2005: 12-16. [13] Wang Xiaoping. Vega Prime real time 3d virtual reality development technology[M]. Chengdu, Southwest Jiaotong University press, 2012: 128-133.