Zeitschriftendaten
Format
Zeitschrift
eISSN
2444-8656
Erstveröffentlichung
01 Jan 2016
Erscheinungsweise
2 Hefte pro Jahr
Sprachen
Englisch
Uneingeschränkter Zugang

3D Animation Simulation of Computer Fractal and Fractal Technology Combined with Diamond-Square Algorithm

Akzeptiert: 30 Mar 2022
Zeitschriftendaten
Format
Zeitschrift
eISSN
2444-8656
Erstveröffentlichung
01 Jan 2016
Erscheinungsweise
2 Hefte pro Jahr
Sprachen
Englisch
Introduction

The most used method in practical applications is based on the real-time generation technology of digital 3D animation models. Due to the huge original data set of real three-dimensional animation, the real-time display requires high hardware. Many applications do not need to simulate the real 3D animation data in a specific area but hope to flexibly generate 3D animations with different characteristics to meet different requirements [1]. We need to temporarily add a 3D animation with good visual effects as an auxiliary environment modeling to ensure the realism of the entire virtual environment. It is not economical and applicable to still use the 3D animation generation method based on DTM data. But the application of fractal technology to generate three-dimensional animation can solve this problem. We can use fractal technology to realize the generation of realistic virtual three-dimensional animation with as little data as possible.

Fractal 3D animation modeling is a very important part of 3D animation modeling. Many fractal 3D animation models are related to the mathematical model of fractal Brownian motion. Fractal Brownian motion provides a method of interpolation between known data points. It is very effective for generating connections between known 3D animation data points. Many methods can produce Brownian motion. Fractal 3D animation modeling methods can be roughly summarized into five categories: midpoint displacement method, Poisson step method, Fourier filter method, successive random increase method, and band-limited noise accumulation method.

Introduction to Random Midpoint Displacement Method

The midpoint displacement method is also called the random midpoint displacement method. This is the simplest and classic method, and it is also a direct application of fractal Brownian motion. The elevation of the midpoint of the line segment whose end elevation is known is the average of the elevations of the two endpoints [2]. After displacement, the two line segments are subdivided and displaced by the midpoint, as mentioned earlier, and recursively until the required resolution is met. We generalize it to two dimensions. According to the different ways of surface meshing, the simulation can be divided into triangle edge subdivision method, square-square subdivision method, rhombus-square method, and other methods. The realization idea is similar to one-dimensional.

Triangle edge subdivision method

A typical triangle edge subdivision method is shown in Figure 1. The subdivision method divides the sides of the triangle equally and then connects the spare midpoints. Such a triangle becomes four small triangles [3]. Then add a Gaussian random offset to each midpoint. The following formula gives its standard deviation: $S=k2−iH$ S = k{2^{ - iH}} i is the number of iterations. K is a scale factor. H is the Hurst index. Each triangle is subdivided in an unpredictable sequence at different times. We make the common sides of two adjacent triangles have the same displacement in elevation to ensure a good connection between the triangles [4]. In addition, because there is no information transfer between adjacent triangles, this method has nothing to do with the subdivision operation before and after.

Square-square subdivision method

As shown in Figure 2, the position coordinate elevation value of the interpolation point is determined by the weight ratio of 9:3:3:1. The closest point has the largest weight coefficient. This interpolation method constitutes the effect of a double quadric surface. One of its important advantages is that the normals of the landscape surface are continuous, so the “crease phenomenon” in the triangle subdivision method is eliminated [5]. In addition, due to the effect of the double quadric surface, the contour of the landscape constructed by this algorithm is relatively soft. We can also make the surface rougher by reducing H.

Although the midpoint displacement method is simple and fast, it is usually difficult to predict the approximate shape of the generated result. Some improved algorithms have appeared in response to this problem.

Diamond-square subdivision method

Perform fractal interpolation in two-dimensional space to generate fractal three-dimensional animation data. Two-dimensional FBM is a very effective fractal model. The realistic three-dimensional animation surface is used as a random fractal, so we can use fractal FBM to describe it better [6]. There are many ways to construct fractal FBM at present. The most commonly used methods are the random midpoint displacement method based on grids and the random midpoint displacement method based on triangles. The former method is suitable for grid three-dimensional animation data with regular divisions. At present, most 3D animation models use grid 3D animation data. This article uses this method to build a fractal three-dimensional animation surface.

The midpoint offset method in three-dimensional space is developed from one-dimensional space. The FBM curve is generated in one-dimensional space by dividing the initial line segment into two equal parts. It is generated by adding an appropriate Gaussian variable at each midpoint. Applying the midpoint offset rule in three-dimensional space is slightly different from this. In the three-dimensional space, a three-dimensional animation with FBM characteristics should be generated [7]. We can use the idea of a midpoint shift offset on a two-dimensional base plane to generate the third coordinate of the point. This can complete the modeling process of the desired mountain range (Figure 3).

In the three-dimensional space O-XYZ, choose the square OABC on the XOY plane as the base plane. We set the horizontal projection of the space point P(x, y, z) in the basic plane. Then the height coordinate z can be generated by the midpoint offset method. As shown in Figure 4, suppose that the heights of the four corner points of the square base plane OABC are known. The values are Z00, Z01, Z11, Z10 respectively. Then the height value Zm at the center M of the square can be obtained by adding a random disturbance to the average height values at the four corner points. $Zm=Z00+Z01+Z11+Z104+D0$ {Z_m} = {{{Z_{00}} + {Z_{01}} + {Z_{11}} + {Z_{10}}} \over 4} + {D_0}

Zm is the height value at the center of the square base plane. Z00, Z01, Z11, Z10 are the height values at the four corner points of the base plane respectively. D0 is the random offset at the center point. It is a Gaussian random variable 0 with mean and variance δ2.

As shown in the figure above, cross the midpoint M and make two parallel lines DEFG on opposite sides. It can divide the square into four smaller squares. We need to obtain the height values ZD, ZE, ZF, ZG at the midpoints of the four sides of the square base plane. The purpose is to determine the height values at the four corners of each small square [8]. The height values at these midpoints can be obtained from the average of the known height values closest to it. like $ZD=Z00+Z012+D0$ {Z_D} = {{{Z_{00}} + {Z_{01}}} \over 2} + {D_0}

ZD, Z00, ZM, Z01 is the corresponding height value on the base plane. D'0 is the corresponding random offset, it is still the mean value of 0. The variance and D0 are the same Gaussian random variables of δ. It is not difficult to infer that the above formula can also obtain the height values at several other midpoints. The original square base plane is equally divided into four smaller squares [9]. The height values at the four corners of each square are also known. Based on the original four known height values, five new height values have been added through calculations. This not only refines the base plane but also increases the density of three-dimensional point elements.

Repeating the above process for each small square can be divided into smaller square grids. At the same time, more three-dimensional point elements with height values are generated. After many iterations, when the density of the three-dimensional point element reaches the requirement, we can get the data model of the geometric object with FBM characteristics.

Determination of random displacement

First, discuss the numerical calculation formula of random displacement. Generally, the following formula is used: $Δi=scale×2−i−H/2×gauss()$ \Delta i = scale \times {2^{ - i - H/2}} \times gauss()

$Δi=diH×δ×1−22H−2×gauss()$ \Delta i = d_i^H \times \delta \times \sqrt {1 - {2^{2H - 2}}} \times gauss() . Scale is the scale factor, which is generally within (0,1). gauss()N(0,1). It obeys the random function of standard normal distribution. is the characteristic parameter value of the extracted area 3D animation. I is the recursive level of random midpoint displacement. di is the line segment spacing after subdivision. $Δi=diH×δ×1−2H−3−22H−4×gauss()$ \Delta i = d_i^H \times \delta \times \sqrt {1 - {2^{H - 3}} - {2^{2H - 4}}} \times gauss()

The above three calculation formulas all use the Gaussian function gauss(). This function does not exist in the C language library function. It would help if you defined your definition based on the central limit theorem in probability theory to sum multiple rand() random numbers and average them. So we have to reduce the speed of fractal 3D animation simulation. Many games and computer simulations that simulate fractal 3D animation generally use the following calculation formulas to achieve real-time requirements: $Δi=(rand ()%(r+1)−r/D)$ \Delta i = \left( {rand\,()\% \left( {r + 1} \right) - r/D} \right) Where D is the fractal dimension. Rand () is a pseudo-random function that comes with the C language library function. The value of r is related to the fluctuation characteristics of the three-dimensional animation.

Algorithm

The rhombus-square method mainly uses the cyclic method to encrypt the raster three-dimensional animation data to generate a three-dimensional animation with any resolution. At the same time, the contradiction between the amount of calculation and the fidelity of the three-dimensional animation is well balanced [10]. So it has become an important method for fractal 3D animation simulation. The following are the commonly used algorithms: $Algorithm fbm−2D(x1,y1,x2,y2,z1,z2,z3,z4,δ,H,n)$ Algorithm\,fbm - 2D\left( {{x_1},{y_1},{x_2},{y_2},{z_1},\,{z_2},\,{z_3},{z_4},\delta ,H,\,n} \right)

Generate 3D grid fractal 3D animation surface between 3D animation areas A(x1, y1, z1), B(x2, y1, z2), C(x3, y3, z3), D(x1, y3, z4).

Parameter description: Intn is the recursion depth. float x1, y1, x2, y2 is the coordinate of the grid matrix object point. float z1, z2, z3, z4 is the height value of each point of the grid. float δ is the standard deviation of the extraction.

Variable description: float xmid, ymid are the midpoint coordinates. float f1, f2, f3, f4, f5 is the height variable of the midpoint of the grid edge. float P1, P2 is the scaling factor.

Call function description:

randGauss () is a random number function that generates a normal distribution N(0,1)

Use OpenGL function to divide grid (x1, y1; x2, y2) into two triangles for three-dimensional display

Rendering:

teturn }

//If the number of recursions is zero, the three-dimensional surface is displayed, and the recursive loop is jumped out;

else

{

P1 = (1 − 22H − 2)1/2

P2 = 2H

xmid = (x1 + x2)/2

ymid = (y1 + y2)/2

f1 = (z1 + z2)/2 + P1 * P2 * δ * randGauss ();

//Perform the elevation of the midpoint of line segment A and B

//Fractal disturbance

f2 = (z1 + z4)/2 + P1 * P2 * δ * randGauss ();

//Perform the elevation of the midpoint of line segment A and D

//Fractal disturbance

f3 = (z2 + z3)/2 + P1 * P2 * δ * randGauss ();

//Perform the elevation of the midpoint of line segments B and C

//Fractal disturbance

f4 = (z3 + z4)/2 + P1 * P2 * δ * randGauss ();

//Adjust the elevation of the midpoint of line segments C and D

//Fractal disturbance

f5 = (z1 + z2 + z3 + z4)/4 + P1 * P2 * δ * randGauss ();

//Fractal perturbation of the height of the midpoint of the line segments A, B, C, D

fbm − 2D(x1, y1, xmid, ymid, z1. f1, f5, f2, P2 * δ, H, n − 1);

fbm − 2D(x1, ymid, xmid, f1, z1, f3, f5, P2 * δ, H, n − 1);

fbm − 2D(xmid, ymid, x2, y2, f5, f3, z2, f4, P2 * δ, H, n − 1);

fbm − 2D(xmid, y1, x2, ymid, f2, f5, f4, z3P2 * δ, H, n − 1);

} Otherwise, the elevation of each midpoint of the area undergoes fractal disturbance. Then the number of recursions is reduced by 1, and the area is divided into four by one. We generate fractal surfaces for each sub-region respectively.

Conclusion

The above gives a brief overview of the fractal landscape modeling algorithm. Due to the complexity of real natural scenes, the amount of calculation for realistic simulation of natural scenes is still very large. Therefore, it is particularly necessary to explore some efficient algorithms. Especially in the virtual simulation system, it is usually desired to produce the effect of real-time animation, so the algorithm's efficiency is more important. Although the midpoint displacement method is simple and fast, it is usually difficult to predict the approximate shape of the generated result. Some improved algorithms have appeared in response to this problem. For example, the basic shape and outline of the generated graphics are not controlled by the given number of initial iterations and initial iteration data.

Shang, Z., Dong, L., Niu, L., & Shi, H. Adsorption of Methane, Nitrogen, and Carbon Dioxide in Atomic-Scale Fractal Nanopores by Monte Carlo Simulation I: Single-Component Adsorption. Energy & Fuels., 2019;33(11): 10457–10475 ShangZ. DongL. NiuL. ShiH. Adsorption of Methane, Nitrogen, and Carbon Dioxide in Atomic-Scale Fractal Nanopores by Monte Carlo Simulation I: Single-Component Adsorption Energy & Fuels 2019 33 11 10457 10475 10.1021/acs.energyfuels.9b01405 Search in Google Scholar

Ruiz-Fernández, J., Benlloch, J., López, M. & Valverde-Gascueña, N. Influence of seasonal factors in the earned value of construction. Applied Mathematics and Nonlinear Sciences., 2019; 4(1): 21–34 Ruiz-FernándezJ. BenllochJ. LópezM. Valverde-GascueñaN. Influence of seasonal factors in the earned value of construction Applied Mathematics and Nonlinear Sciences 2019 4 1 21 34 10.2478/AMNS.2019.1.00003 Search in Google Scholar

Zhiguo, L., Huitao, Z. & Li, Y. A finite element analysis of the impact of split pole shoes on magnetic liquid sealing performance. Applied Mathematics and Nonlinear Sciences., 2021; 6(1): 103–114 ZhiguoL. HuitaoZ. LiY. A finite element analysis of the impact of split pole shoes on magnetic liquid sealing performance Applied Mathematics and Nonlinear Sciences 2021 6 1 103 114 10.2478/amns.2021.1.00017 Search in Google Scholar

WANG, Y., FENG, X., LIANG, W., LI, X., & XUE, C. Subsurface target recognition in Utopia Planitia of Mars by Tianwen-1 FP-SPR simulation. Global Geology., 2021; 24(3): 169–176 WANGY. FENGX. LIANGW. LIX. XUEC. Subsurface target recognition in Utopia Planitia of Mars by Tianwen-1 FP-SPR simulation Global Geology 2021 24 3 169 176 Search in Google Scholar

Lalechère, E., Archaux, F., & Jabot, F. Relative importance of landscape and species characteristics on extinction debt, immigration credit and relaxation time after habitat turnover. Population Ecology., 2019; 61(4): 383–395 LalechèreE. ArchauxF. JabotF. Relative importance of landscape and species characteristics on extinction debt, immigration credit and relaxation time after habitat turnover Population Ecology 2019 61 4 383 395 10.1002/1438-390X.12009 Search in Google Scholar

Wijaya, J. G. H., Andjarwirawan, J., & Adipranata, R. Game Membangun Kerajaan dengan Procedural Generated Map Menggunakan Perlin Noise. Jurnal Infra., 2019; 7(1): 228–231 WijayaJ. G. H. AndjarwirawanJ. AdipranataR. Game Membangun Kerajaan dengan Procedural Generated Map Menggunakan Perlin Noise Jurnal Infra 2019 7 1 228 231 Search in Google Scholar

Grosholz, E. Bridges Linz 2019: Mathematical Art Exhibition. Journal of Mathematics and the Arts., 2020; 14(4): 360–369 GrosholzE. Bridges Linz 2019: Mathematical Art Exhibition Journal of Mathematics and the Arts 2020 14 4 360 369 10.1080/17513472.2019.1691430 Search in Google Scholar

Cortial, Y., Peytavie, A., Galin, E., & Guérin, É. Real-time hyper-amplification of planets. The Visual Computer., 2020; 36(10): 2273–2284 CortialY. PeytavieA. GalinE. GuérinÉ. Real-time hyper-amplification of planets The Visual Computer 2020 36 10 2273 2284 10.1007/s00371-020-01923-4 Search in Google Scholar

Clubb, F. J., Bookhagen, B., & Rheinwalt, A. Clustering river profiles to classify geomorphic domains. Journal of Geophysical Research: Earth Surface., 2019; 124(6): 1417–1439 ClubbF. J. BookhagenB. RheinwaltA. Clustering river profiles to classify geomorphic domains Journal of Geophysical Research: Earth Surface 2019 124 6 1417 1439 10.1029/2019JF005025 Search in Google Scholar

Forster, L., Davis, A. B., Diner, D. J., & Mayer, B. Toward Cloud Tomography from Space using MISR and MODIS: Locating the “Veiled Core” in Opaque Convective Clouds. Journal of the Atmospheric Sciences., 2021; 78(1): 155–166 ForsterL. DavisA. B. DinerD. J. MayerB. Toward Cloud Tomography from Space using MISR and MODIS: Locating the “Veiled Core” in Opaque Convective Clouds Journal of the Atmospheric Sciences 2021 78 1 155 166 10.1175/JAS-D-19-0262.1 Search in Google Scholar

Empfohlene Artikel von Trend MD