You are on page 1of 3

20IO International Conference on Computer Application and System Modeling (ICCASM 2010)

Three-dimensional Ocean Wave Movement Simulation Algorithm Based on Fractal


Xia Yan, Jiang Liu, Lv Hai Hua, Fan Jia Peng and Wu Xiao Hui
Department of Information Engineering, Department of Computer Shenyang Institute of Engineering, Shenyang Railway Polytechnic Shenyang, China winston_xy@I63.com

Abstract-

In recent years, the movement simulation of the

ocean wave is one of the important researches in the nature simulation area. And the simulation method based on the fractal principles is relatively common. The paper introduces the different methods to simulation, describes in realize the current ocean wave detail the random mid-point

II. A.

THEORY AND METHODS BASED ON FRACTAL

Fractal Feature of ocean wave

displacement algorithm according to the fractal Brownian motion (FBM) in fractal theory, proposes a multi-dynamic non-uniform interpolation method, makes an effective solution to the wave jump mentioned methods phenomenon, to achieve a and uses of wave the of above three ocean

dimensional dynamic simulation under the VC + +6.0 and OpenGL environment. It has the features of being better realistic and real-time.

Keyword-Fractal: ocean wave simulation: non-uniform interpolation method: Random midpoint displacement
I.
INTRODUCTION

One of the important features of the fractal theory is self similarity, and the ocean waves can be regarded as periodic waves of different sizes superimposed waveform. The waves have the characteristic of related large-scale and small-scale similarity, and the space is respectively to approximate homogeneity, so the ocean waves have the characteristic of self-similarity. The ocean waves have the fractal characteristic because of the characteristic of self-similarity. We can use the few data production based on this characteristic to have the really third dimension and the timely ocean waves' fluctuation effect.
B.

Implementation of fractal surface waves

The computer simulation of the hypothesized natural environment like terrain, plant and the ocean waves has been one of computer graphics important research subjects, the ocean waves simulation compares other natural environments to be more complex and difficult. Simulation Modeling of the current wave is divided into the following types: Based on computational fluid dynamics method, based on wave spectral method, based on geometric modeling method and based on the fractal geometry. The ocean waves regard as the coherent incompressible flow body based on the computation hydromechanics method, although this method can generate realistic wave motion effects, but because of its solution process is too complicated, in practice rarely used in applications. The basic idea of the Wave spectrum method is to produce one to have the same spectrum characteristic high field with the real sea, and this method suits the fluctuation effect of the ocean waves in the simulation. Methods based on geometric model of the geometric curve or surface wave structure changes the shape of a continuous wave form according to the characteristics. The fractal geometry method uses the FBM method to produce the fractal surface of ocean waves, and the generate coordinates of points is set to function with the time and space-related to produce the effect of ocean waves, and with ensuring the continuity of the image by interpolation method.

We use the random mid-point displacement algorithm according to the Fractal Brownian Motion (FBM) in fractal theory to produces the ocean waves' fractal surface. Generally the random mid-point displacement algorithm includes triangular boundary method, square method, diamond method and diamond - square method. This article uses diamond square shape law in the following introduction. As shown in Figure I: First step starts a square four spot, the four points A, B, C, D have different height values were hA, hE, he ,hf) and calculates the high value of the center point 0, then calculate the location and the height of the midpoint of each side of quadrilateral according to the value of 4

Pmgggg
2 4

Figure 1,

Diamond - Square method

So a square can generate four squares in the first process of subdivision as shown in Figure I.Symbols in the Figure 1 is the point of the initial square, and symbols is the midpoint of the initial square calculated according to the 4 initial square points, symbols is the midpoint of the square calculated according to the point and the midpoint of the initial square, then produce four new squares and calculate the new height of them. So it can generate 16 squares in the second process of subdivision and generate 64 squares in the third process, and it can generate 22i squares after i process. Because of the different height of square

978-1-4244-7237-6/10/$26.00 mOl0 IEEE

VlO-482

2010 International Conference on Computer Application and System Modeling (lCCASM 2010)

points, it can produce an approximate surface after several processes of iterations, which are close the real ocean waves.
C.

C.

Geometric model of wave motion

Random function equation

Random height is the very important function in the process of generating surface waves based on fractal. At present the random number based on the FBM method can be used Gauss function (Gauss ) to generate. Because it is not exist in the library function of VC++, need to use the Gauss function according to principles of probability methods. In order to improve the simulation speed effectively, use a simpler random function equation to replace the Gauss function, the function is as follows:
= + / ( 1) Parameter d is the fractal iterations, function rand ( ) is the random function belongs to the library function of VC++; r is the parameter of the ocean wave height relating to factors which affect fluctuations of the ocean wave.

The effect of wave generated based on fractal is static, in order to achieve the fluctuating effect of the waves, we set off the point for generating high value is a function related to time and space. So the movement patterns of the wave can be seen as a series of rules by the superposition of waves with different frequency, wave number, and height and propagation direction, just like simple three-dimensional moving wave. Its sole waveform components form may use (2)to define:
y

( x, z , t)

A,sin ( k,x- t; t + IP; ) cos ( k,z - t;t + IP;) (2)

gO (randO%(r 1) -r d)

Parameter named Ai is height of wave, ki is the number of wave, OJi is frequency, rpi is random phase angle, t is the time variable. So the wave surface equation in the coordinates (x, y) may use (3)to express. The wave face on t is superimposed by the waves with different frequency and height. Now introduce the determination of parameters. y (x,.:-,t)=

III.

PRINCIPLES AND METHODS OF WAVE MOTION SIMULATION

t
1=1

A, sin (k,x- t; t + IP, ) cos(k, .:-- t; t + IP, )

(3)

A.

Characteristics af the wave movement

Characteristics of the wave movement are complex and mainly in the shape of irregular waves, with complexity and randomness, many external forces in the movement of waves just like wind. Its movement characteristic may summarize for superimposition of the approximate periodic regular profile superimposition, so the movement patterns of the wave can be seen as a series of rules by the superposition of waves with different frequency, wave number, and height and propagation direction, just like simple three-dimensional moving wave.
B.

Parameter Ai is height of wave movement, one of the important parameters affecting wave form, determined according to the size of the wind level; ki is the number of wave, in ideal status, according to the linear wave theory, k oi / g parameter g is acceleration of gravity. The
=

parameter ki of wave number is determined by parameter OJi ; parameter rpi is a value generated by the random function, its utility is random forcing function and its value range is

[0,21r]
D.

Wave movement factors

Method of multi-dynamic non-uniform interpolation

Ocean waves caused by many reasons, one of the most common movement patterns effects on waves is the wind. The main driving force of the ocean wave is the wind. The characteristics of the wave movement, including height and speed, have close contacting with the wind power size. In the process of using computer simulation of wave movement, many parameters are closely related with the wind. Relation of wind, wave height and wave period, as shown in the table 1:
TABLE!

PARAMETERS OF WAVE MOTION SIMULAnON

Computer simulation of waves requires large amounts of data to achieve, Random numbers generated using the stochastic equation have the properties of unpredictability and uncontrollable, it is possible to calculate the wave height vary greatly between the two adjacent on time, so effects of simulated and real fluctuations are quite different. In order to makes an effective solution to the wave jump phenomenon, we propose a multi-dynamic non-uniform interpolation method, and the concrete method is as follows: First, determine the coordinate in time
tl

of point p based
0

Simalatio n of scale
0 1 2 3 4 5 6 7 8

Wave height 1m
0 0.0-0. 15 0. 15-0.5 0.5-1.25 1.25-2.5 2.5-3.75 3.75-4.25 4.25-6 6-8

Wave cyclesls
0 1 1.8 3.5 4.7 5 6.5 8.2 10

Simulation ofwave heixhticm


0 0. 125 0.25 0.4 0.575 0.775 1 1.25 1.625

Simalatio n of wave cyclesls


0 1 1.8 3.5 4.7 5 6.5 8.2 10

on random mid-point displacement algorithm. In the first process of subdivision, the coordinates of the midpoint of the square may use (4) to define and midpoint E on the side AB can use (5) to define:

VIO-483

2010 International Conference on Computer Application and System Modeling (ICCASM 2010)

S So

( x , y ,z,tl ) ( SA +SB + Sc + SD ) + g u essO


+

(4)

+gteSS\) (5) 3 We can generate different wave height at different times, and effects of wave movement to generate the changes over time. Then set the coordinates of point P on two adjacent time moments is (x,y,z,tl) and (x,y,z,t2) , and three parameters define the name for the d, I, n, parameter named d ( x,y,z,tJ)
/<..

( ( x,y,z,tJ) A+( x,y,z,tJ) B+( x, y,z,tJ) 0)

and use Swap Buffers to exchange images in buffer to draw wave motion image. Based on the above algorithm, using VC++6.0 and OpenGL to simulate three-dimensional wave movement on Pc. V.
CONCLUSIONS

is the difference in height of point P between

t1

and tz I is
'

Degree of uniformity, and n is the number of dynamic interpolation point, n=Int (d/l).So the coordinates

(x,y,z) may use (6) to express: ( x,y,z,tn ) ( x,y,z,tl ) +


=

( ) ((
tn t - J t2 - tl

The ocean waves have the fractal characteristic by analyzing the wave of specific form, and it can be regarded as periodic waves of different sizes superimposed waveform, also the waves have the characteristic of related large-scale and small-scale similarity. The paper describes in detail the random mid-point displacement algorithm according to the fractal Brownian motion (FBM) in fractal theory. In order to make an effective solution to the wave jump phenomenon, proposes a multi-dynamic non-uniform interpolation method, which can effectively reduce the wave jump phenomenon.
REFERENCE [I] Chu Yan-jun, Kang Feng-ju,"Fractal-based Ocean Wave Model for Visual Simulation," Journal of System Simulation,2006,voLs2,pp.39 1-393 Du Yan,Zhang Xiaoyu, LI Wen_xiu, "Computerized Simulation of Ocean Wave Forms in VR Secnes," Journal of Harbin Engineering University, 200 1,voL22,pp. 26-29. Xie Wei, Guo Qisheng,Dong Zhiming, "Real-time Visual Simulation of Ocean Wave," Computer Engineering and Applications,200 1,voL20,pp. 123-l25. Peng Geng,Zhang Li-min,Ai Zu-liang,Deng Xiang-yang,"Real-time Simulation of Three-dimensional Multi-resolution Ocean Wave Based on Fractal," Computer Engineering and Applications,2006, vo1.33,pp.II-15. Liang Jun, Jiang Jin-long,Zhao Xue-lian,Cheng Guo-you,Chen Jin bo," The applicability analysis of MPD method in 3D terrain interpolation," Science of Surveying and Mapping, 2007,vo1.32,pp.44-46. Zeng Fantao ,"Real-time Wave Simulation Based on Texture mapping," Microcomputer Applications,2007, vo1.28,pp. 1029- 1033.

x,y, Z,t2 - x,y, Z,tl

) (

)) (6)

When

= =

0 , it is can reach the conclusion that


, that is to say not need to add

(x,y,z,tn) (x,y,z,t z)

interpolation points; when n > 0, add one or more points according to parameter d. This method can effectively reduce the image discontinuity caused by the properties of unpredictability and uncontrollable nature of random numbers in order to improve the results of simulation. IV.
SIMULATION ALGORlTHM OF WAVE MOTION

[2]

[3]

[4]

In order do simulate the effect of surface movement; we must set the function of wave height to relate time, so we can produce the movement results along with the time variation. The realization process is as follows: 1) Calculate the point coordinates

[5]

(x,y,z) of

fractal

surface generation; 2) Set the coordinates for the function relate time as (7), wave height Yi changes with time; Yi ( x,z,t ) A i s in ( kix - t+ tP;) cos ( kiz - t+ IPi ) (7) 3) Based on the input value of wind power, find the simulation of wave height Ai and the cycle 1; in Table 1,
=

[6]

then calculate 01;

1 / 1; , k

oi / g and 'Pi ;
1S

4) Calculate the value of parameter d, which difference in height of point P between

the then

tl

and

tz ;

calculate the number Pi of dynamic interpolation point,

Pi

Int(

d) I);

5) Use (6) in 3.4 to calculate the coordinate of


interpolation points, and Pi
=

Pi

6) Repeat step 5 until Pi = 0, dynamic interpolation is to end; 7) By using the function named Set Pixel Format in OpenGL, Set the display format is double-buffering mode,

VIO-484

You might also like