摘要
针对L系统的数学模型和构图原理提出对具有自相似结构的植物在三维空间内进行计算机模拟的算法研究。将L系统对植物的模拟的应用从二维空间转变到三维空间,定义3个空间坐标轴上的余弦值X,Y,Z与3个给定的3个坐标轴上的旋转矩阵的乘积作为植物在3个坐标方向上旋转参数,使绘制出的植物产生明显的三维效果。并且以VC++6.0作为运行环境,结合OPENGL函数库提供的强大绘图功能,对算法进行计算机上的实现。探讨了通过增加植物的绘制次数,改变观察者视点的位置,实现对树林的模拟。通过引入随机数产生器使行、列间距离产生随机变化,同时也能够随机调用不同的字符串复写规则使树林中产生不同类型、颜色、大小的树木,提高了对自然景物模拟的逼真度。
Based on the model of mathematics of L system and composition principle, put forward computer simulation algorithm investigation about the plant of the similar structure in three - dimensional space. Change the application of simulation of the plant of L system from two - dimensional space to three- dimensional space. Define product of the cosine value on three space coordinate axes X, Y, Z and three given definitely rotation matrix in the respective coordinate axe as the rotation parameter of plant in the three coordinate axes, and make the plant drawn out to produce the obvious three- dimensional result. And with VC+ + 6.0 combines the strong drawing function offered in OPENGL function storehouse on this basis as the running environment, carry on the realization on the computer to the algorithm. Probe into through increasing the number of times of drawing the plant, change the position of observer's view point, realize the simula- tion of the woods. Finally through lead into random number generator make row, rank rooms of distance produce at random changing, can transfer different character clusters of facsimile rule make woods produce different kinds of at random at the same time, the color, the trees of the size. The fidelity to natural scene simulation is improved.
出处
《计算机技术与发展》
2006年第10期108-110,117,共4页
Computer Technology and Development
基金
辽宁省自然科学基金资助项目(20022161)
关键词
分形
L系统
三维
植物
计算机模拟
fractal
L-systean
three-dimension
plant
computer simulation