为解决目前仿真系统中闪电结构生成算法的时间和空间复杂度较高的问题,提出了一种基于多重细分的闪电仿真方法。该方法采用不断细分的思想,通过在一条线段间不断插入顶点并控制Z形和叉形结构的生成次数来得到形态逼真的闪电结构,同时通过在闪电线条周围添加矩形并在矩形内填充由线性插值生成的颜色来实现闪电的发光效果。为了使闪电效果更加逼真,在水平和竖直方向上分别用高斯模糊对闪电进行处理来生成其周围的燃烧颜色。实验结果表明,该方法实现的闪电效果逼真,效率高,能够较好地满足仿真要求。
To lower the time and space complexity of the lightning structure rendering, a method of lightning simulation based on multiplesubdivisions is presented. The structure of a lightning beam is created by using fractal subdivision of line segments, the lifelike lightning structure is formed by inserting vertexes and controlling the proportion of Z shape and fork shape fractals, and the glow effects of the lightning is achieved by adding some rectangles with colors which are created with linear interpolation. In order to get vivid effects, the horizontal and vertical Gaussian blur are implemented to get burning is available to satisfy requirements of the simulation system. color. Experimental result shows that the method is of great use and