南京林业大学学报(自然科学版) ›› 2023, Vol. 47 ›› Issue (5): 19-27.doi: 10.12302/j.issn.1000-2006.202208020

所属专题: 林草计算机应用研究专题

• 专题报道:林草计算机应用研究专题(执行主编 李凤日) • 上一篇    下一篇

一种优化森林仿真的碰撞检测及响应算法研究

王林龙1,2,3(), 张怀清1,3,*(), 杨廷栋1, 张京1, 雷可欣1, 陈传松4, 张华聪1, 刘洋1, 崔泽宇1, 左袁青1   

  1. 1.中国林业科学研究院资源信息研究所,北京 100091
    2.中国林业科学研究院林业科技信息研究所,北京 100091
    3.国家林业和草原局林业遥感与信息技术重点实验室,北京 100091
    4.中国林业科学研究院亚热带林业实验中心,江西 分宜 336600
  • 收稿日期:2022-08-09 修回日期:2022-10-04 出版日期:2023-09-30 发布日期:2023-10-10
  • 通讯作者: *张怀清( zhang@ifrit.ac.cn),研究员。
  • 作者简介:王林龙(wangll1988@caf.ac.cn),助理研究员。
  • 基金资助:
    中国林业科学研究院资源信息研究所基本科研业务费专项项目(CAFYBB2019SZ004);国家自然科学基金项目(32071681)

Research on algorithm of collision detection and response to optimize forest simulation

WANG Linlong1,2,3(), ZHANG Huaiqing1,3,*(), YANG Tingdong1, ZHANG Jing1, LEI Kexin1, CHEN Chuansong4, ZHANG Huacong1, LIU Yang1, CUI Zeyu1, ZUO Yuanqing1   

  1. 1. Research Institute of Forest Resource Information Techniques, CAF, Beijing 100091, China
    2. Research Institute of Forestry Policy and Information, CAF, Beijing 100091, China
    3. Key Laboratory of Forestry Remote Sensing and Information Technology, National Forestry and Grassland Administration, CAF, Beijing 100091, China
    4. Experimental Center of Subtropical Forestry,CAF, Fenyi 336600, China
  • Received:2022-08-09 Revised:2022-10-04 Online:2023-09-30 Published:2023-10-10

摘要:

【目的】 针对森林碰撞检测研究中存在碰撞检测对象冗余、碰撞响应模式单一性等问题,研究突破碰撞检测算法时间复杂度高、响应模式缺乏与环境因子交互的技术瓶颈,实现虚拟森林场景快速碰撞检测与真实响应。【方法】 以亚热带林业实验中心山下林场的典型林分杉木(Cunninghamia lanceolata)人工纯林为研究对象,选择碰撞检测总消耗的时间t1、包围盒交叉测试时间t2、包围盒构建时间t3、包围盒更新时间t4作为评价指标,比较单一包围盒树(axis-aligned bounding box, AABB)、混合包围盒树体(mixed bounding volume tree, MBVT)算法及引入最近4株树搜索法的MBVT优化算法的碰撞检测效率,分析不同规模大小(20、50、100、200、400、600、800、1 000)及林分株行距(1 m×1 m、2 m×2 m、3 m×3 m、4 m×4 m)双因子对碰撞检测效率的影响机制,最后模拟验证考虑光照因子碰撞响应策略的可行性。【结果】 ①相对MBVT算法,基于最近4株树搜索法的混合包围盒层次树MBVT优化算法耗时缩短了13.75 ms,约为原MBVT算法耗时的29%,能有效减少层次包围盒(bounding volume hierarchies, BVHs)交叉测试时间消耗t2与BVHs构建消耗时间t3,而更新时间t4无明显差异。相对单一包围盒层次树AABB,MBVT算法与基于最近4株树搜索法的MBVT优化算法,分别缩短了124.93、138.68 ms,约为单一包围盒层次树法AABB总耗时的73%、81%。②种群规模大小与BVHs碰撞检测总消耗时间t1、BVHs交叉测试时间t2及构建时间t3均表现为正相关性;株行距大小与碰撞检测总耗时间t1与相交测试时间t2呈负相关性,与BVHs构建时间t3无明显关联性;随种群规模增大,株行距减小,总碰撞时间消耗t1、BVHs交叉测试时间t2呈增加趋势,而BVHs构建时间t3几乎没有变化。③相比传统的碰撞响应模式,提出的顾及光照因子碰撞响应模式,考虑了植物的趋光性生长特征,模拟的杉木林虚拟场景更为真实。测试虚拟场景的帧率为8.6 帧/s,准确度为100%,能很好地实现相邻树木之间碰撞检测及其响应。【结论】 引入最近4株树搜索法的MBVT优化碰撞算法,优化混合包围盒层次树法MBVT的碰撞检测对象数量,减少了BVHs交叉测试和构建消耗时间,从而有效提高杉木林虚拟场景的碰撞检测效率;顾及树木生长趋光性的相邻树木碰撞响应算法,通过兰伯特光照模型Lambert Model计算碰撞点周围的光照强度,结合碰撞响应函数完成树木碰撞后可能发生的趋光生长情景模拟,有效解决了森林碰撞响应缺乏与环境因子交互的问题,提高了杉木林虚拟场景的真实感。

关键词: 森林仿真, 碰撞检测, 碰撞响应, 混合包围体层次树, 杉木林

Abstract:

【Objective】 Research into virtual forest collision is hampered by redundant detection objects and simple collision response modes. Our study addresses the technical bottlenecks of high time-cost collision-detection algorithms (aiming to achieve a rapid detection of collisions) and a lack of interaction between the response mode and environmental factors (in favor of real response in virtual forest scenes). 【Method】 We studied a pure-planted Chinese fir (Cunninghamia lanceolata) forest on Shanxia Farm, based at the Experimental Center of Subtropical Forestry in the Chinese Academy of Forestry. Our study compared the efficiency of three methods for the collision detection: an axis-aligned bounding box (AABB) algorithm;a mixed bounding volume hierarchy tree (MBVT) algorithm and a MBVT algorithm optimized using a ‘Finding-the-Four-Closest-Trees’ method, to understand the effect of population size and plant density on collision-detection efficiency and to explore the feasibility of collision response under the strategy proposed in our study.【Result】The total consumption time, t1 for our optimized ‘Finding the Four Closest Trees’ method was approximately 29% that of the MBVT algorithm: 13.75 ms shorter. Compared with the BVH, the cross-test time consumption, t2 was effectively reduced, as was the construction time consumption(t3) and updating time(t4). Both the MBVT and optimized MBVT algorithms reduced the total consumption time, t1 was approximately 73% and 81% that of a single BVH tree AABB by 124.93 and 138.68 ms, respectively. Population was positively correlated with t1, t2 and t3 of the BVH tree: total consumption time, intersection-test time, and construction time. There was a negative correlation between the density of different plants and the total consumption time(t1) and intersection-test time(t2) and no significant correlation with construction time(t3). Conversely, an increase in population and decrease in plant density saw an increase in the total consumption time(t1) and intersection-test time(t2), while there was no significant difference in construction time(t3). Compared with traditional collision response models, the proposed collision response algorithm took into account phototaxis and more realistically simulated a virtual scene of Chinese fir. The virtual scene had a frame rate of 8.6 frames per second and an accuracy of 100%. 【Conclusion】 Improving a MBVT algorithm using our ‘Finding the Four Closest Trees’ can optimize the number of collision detection objects in mixed bounding box hierarchy trees, reducing the consumption time of BVH cross tests and construction to improve collision detection efficiency in a virtual forest of Chinese fir. A collision response strategy for adjacent trees, which accounts for phototaxis, can solve the problem of collision response without interacting with environmental factors in virtual forest scenes, improving the realism of a Chinese fir virtual forest with the Lambert model and collision response function.

Key words: forest simulation, collision detection, collision response, mixed bounding volume hierarchy trees, Chinese fir (Cunninghamia lanceolata) forest

中图分类号: