| Real simulation of natural phenomena by computer, such as simulation smoke, has been one of the most challenging of research directions. To realize their simulation, a method based on particle systems and a method based on physical models have often been used by computer graphics researchers. As the algorithms in studying physical properties of fluid are more and more mature in fluid mechanics, and algorithm complexity completed by computer continuously rises, to simulate natural phenomena (such as smoke) by the method based on physical models has become a hot topic in computer graphics. And this method is used to achieve diffusion simulation of smoke in this paper.There are three steps in simulating smoke by the method. First, determine the physical models of smoke. Second, solve the physical models of smoke. Third, draw smoke.Realistic animation and real-time simulation have been two objectives pursued in computer graphics applications. In this paper, the two objectives are fully considered into the given physical models of smoke. The non-viscous incompressible Euler equations are used as a basic physical model of simulation smoke, which simplifies the numerical computation and makes it possible to assure real-time calculation. In order to get a vivid visual presentation, a vortex in fluid is described by adding a vorticity confinement force, and the gravity, thermal buoyancy and vorticity confinement force of smoke make up the external forces. In addition, the gravity of smoke is associated with its density, thermal buoyancy is associated with its temperature, and thus the density and temperature change with the velocity field of advection are also considered.In this paper, the finite difference method is mainly used in solving the model equations of smoke. A non-staggered grid is employed to discretize the solving region of model equations, while the basic model equations are simplified by Helmholtz-Hodge decomposition, and the "splitting" is used to solve the simplified equations. In order to guarantee the unconditional stability in solving the equations, semi lagrangian scheme is employed to solve the advection term. An implicit method is employed in solving diffusion term and projection term, such as Gauss-Seidel iteration method, Fast Fourier Transform.In this paper, the smoke is drawn by means of OpenGL rendering technology and OpenGL GLUT. Considering the complicity and consuming time calculated by Volume Rendering Method and the realistic of smoke not being affected, a simple solution is employed, which is to draw a series of quadrilaterals by the certain density smoke defined in the center of grid unit, the position of each vertex is determined by space interval, and its color is determined by the density value of the corresponding vertex. In the given time steps, all the smoke on the grid unit with density value stored in it are drawn and the diffusion effect can be seen when all the smokes are connected. The diffusion effect of smoke is rendered in both closed space and open. |