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

王林龙, 张怀清, 杨廷栋, 张京, 雷可欣, 陈传松, 张华聪, 刘洋, 崔泽宇, 左袁青

南京林业大学学报(自然科学版) ›› 2023, Vol. 47 ›› Issue (5) : 19-27.

PDF(4010 KB)
PDF(4010 KB)
南京林业大学学报(自然科学版) ›› 2023, Vol. 47 ›› Issue (5) : 19-27. DOI: 10.12302/j.issn.1000-2006.202208020
专题报道:林草计算机应用研究专题(执行主编 李凤日)

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

作者信息 +

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

Author information +
文章历史 +

摘要

【目的】 针对森林碰撞检测研究中存在碰撞检测对象冗余、碰撞响应模式单一性等问题,研究突破碰撞检测算法时间复杂度高、响应模式缺乏与环境因子交互的技术瓶颈,实现虚拟森林场景快速碰撞检测与真实响应。【方法】 以亚热带林业实验中心山下林场的典型林分杉木(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

引用本文

导出引用
王林龙, 张怀清, 杨廷栋, . 一种优化森林仿真的碰撞检测及响应算法研究[J]. 南京林业大学学报(自然科学版). 2023, 47(5): 19-27 https://doi.org/10.12302/j.issn.1000-2006.202208020
WANG Linlong, ZHANG Huaiqing, YANG Tingdong, et al. Research on algorithm of collision detection and response to optimize forest simulation[J]. JOURNAL OF NANJING FORESTRY UNIVERSITY. 2023, 47(5): 19-27 https://doi.org/10.12302/j.issn.1000-2006.202208020
中图分类号: S750   

参考文献

[1]
WANG M N, CAO J Q. A review of collision detection for deformable objects[J]. Comput Animat Virtual Worlds, 2021, 32(5):e1987.DOI: 10.1002/cav.1987.
[2]
CHOI A R, SUNG M Y. Performance improvement of haptic collision detection using subdivision surface and sphere clustering[J]. PLoS One, 2017, 12(9):e0184334.DOI: 10.1371/journal.pone.0184334.
[3]
MOORE M, WILHELMS J. Collision detection and response for computer animationr3[C]// Proceedings of the 15th annual conference on computer graphics and interactive techniques-SIGGRAPH’88.Not Known. New York: ACM Press, 1988:289-298.DOI: 10.1145/54852.378528.
[4]
LIN M C, GOTTSCHALK S. Collision detection between geometric models: a survey visual computer, 1998, 11(10):542-561.DOI:10.1007/BF02434040.
[5]
JIMÉNEZ P, THOMAS F, TORRAS C. 3D collision detection:a survey[J]. Comput Graph, 2001, 25(2):269-285.DOI: 10.1016/S0097-8493(00)00130-8.
[6]
WALD I. On fast construction of SAH-based bounding volume hierarchies[C]// 2007 IEEE Symposium on Interactive Ray Tracing.September 10-12,2007.Ulm:IEEE, 2007:33-40.DOI: 10.1109/rt.2007.4342588.
[7]
MADERA F A, DAY A M, LAYCOCK S D. A hybrid bounding volume algorithm to detect collisions between deformable objects[C]// 2009 Second International Conferences on Advances in Computer-Human Interactions. February 1-7,2009,Cancun,Mexico:IEEE, 2009:136-141.DOI: 10.1109/ACHI.2009.13.
[8]
郑萍, 赵春江, 张继成. 基于关键点存取的虚拟植物碰撞检测方法的研究[J]. 东北农业大学学报, 2011, 42(8):78-82.
ZHENG P, ZHAO C J, ZHANG J C. Study on virtual plant collision detection method based on save and access of key point[J]. J Northeast Agric Univ, 2011, 42(8):78-82.DOI: 10.3969/j.issn.1005-9369.2011.08.015.
[9]
李长锋, 郭新宇, 赵春江, 等. 基于空间散列法的虚拟植物碰撞检测算法[J]. 计算机应用与软件, 2009, 26(4):242-245.
LI C F, GUO X Y, ZHAO C J, et al. Spatial hashing based collision detection algorithm for virtual plants[J]. Comput Appl Softw, 2009, 26(4):242-245.DOI: 10.3969/j.issn.1000-386X.2009.04.082.
[10]
秦铨, 赵春江, 肖伯祥, 等. 基于AABB-OBB盒的玉米叶片碰撞检测[J]. 农机化研究, 2012, 34(1):177-180.
QIN Q, ZHAO C J, XIAO B X, et al. Collision detection for maize leaves based on AABB-OBB bounding volumes[J]. J Agric Mech Res, 2012, 34(1):177-180.DOI: 10.3969/j.issn.1003-188X.2012.01.043.
[11]
伍艳莲, 汤亮, 曹卫星, 等. 作物可视化中的碰撞检测及响应研究[J]. 计算机科学与探索, 2011, 38(10):263-266,284.
WU Y L, TANG L, CAO W X, et al. Collision detection and response in crop visualization[J]. J Front Comput Sci Technol, 2011, 38(10):263-266,284.DOI: 10.3969/j.issn.1004-731X.2007.07.023.
[12]
KIM Y J, WOO J H, KIM M S, et al. Interactive tree modeling and deformation with collision detection and avoidance[J]. Comput Animat Virtual Worlds, 2015, 26(3/4):423-432.DOI: 10.1002/cav.1661.
We present an interactive tree modeling and deformation system that supports an efficient collision detection and avoidance using a bounding volume hierarchy of sweep surfaces. Starting with conventional tree models (given as meshes), we convert them into sweep surfaces and deform their branches interactively while detecting and avoiding collisions with many other branches. Multiple tree models (sharing the same topology) can be generated with great ease using this sweep‐based approach, and they can serve as a basis for the generation of a multiparameter family of trees. We demonstrate the effectiveness of our approach in an automatic generation of similar trees, the colonization of trees to form a forest, and the tree growth, aging, and withering simulations. Copyright © 2015 John Wiley & Sons, Ltd.
[13]
XIAO B, GUO X, WANG C, et al. Collision detection based on biomimetic pattern recognition for virtual plant[J]. Icic Express Letters, 2015, 9(5): 1413-1418.
[14]
TANG L, SONG W G, HOU T C, et al. Collision detection of virtual plant based on bounding volume hierarchy:a case study on virtual wheat[J]. J Integr Agric, 2018, 17(2):306-314.DOI: 10.1016/S2095-3119(17)61769-6.
[15]
惠刚盈, 胡艳波. 混交林树种空间隔离程度表达方式的研究[J]. 林业科学研究, 2001, 14(1):23-27.
HUI G Y, HU Y B. Measuring species spatial isolation in mixed forests[J]. For Pesearch, 2001, 14(1):23-27.DOI: 10.3321/j.issn:1001-1498.2001.01.004
[16]
DING W L, WAN Z X, XU Y, et al. New collision detection method for simulating virtual plant populations[J]. Int J Agric Biol Eng, 2019, 12(6):156-161.DOI: 10.25165/j.ijabe.20191206.4888.
[17]
COMMONER B, LIPKIN D. The application of the beer-lambert law to optically anisotropic systems[J]. Science, 1949, 110(2845):41-43.DOI: 10.1126/science.110.2845.41-a.
[18]
XIE K, YAN F L, SHARF A, et al. Tree modeling with real tree-parts examples[J]. IEEE Trans Vis Comput Graph, 2016, 22(12):2608-2618.DOI: 10.1109/TVCG.2015.2513409.
We introduce a 3D tree modeling technique that utilizes examples of real trees to enhance tree creation with realistic structures and fine-level details. In contrast to previous works that use smooth generalized cylinders to represent tree branches, our method generates realistic looking tree models with complex branching geometry by employing an exemplar database consisting of real-life trees reconstructed from scanned data. These trees are sliced into representative parts (denoted as tree-cuts), representing trunk logs and branching structures. In the modeling process, tree-cuts are positioned in space in an intuitive manner, serving as efficient proxies that guide the creation of the complete tree. Allometry rules are taken into account to ensure reasonable relations between adjacent branches. Realism is further enhanced by automatically transferring geometric textures from our database onto tree branches as well as by guided growing of foliage. Our results demonstrate the complexity and variety of trees that can be generated with our method within few minutes. We carry a user study to test the effectiveness of our modeling technique.
[19]
白静, 张怀清, 刘闽. 合轴分枝树木形态结构三维可视化模拟方法[J]. 林业科学, 2014, 50(12):73-78.
BAI J, ZHANG H Q, LIU M. Three-dimensional visual simulation of sympodial branching trees morphological architecture[J]. Sci Silvae Sin, 2014, 50(12):73-78.DOI: 10.11707/j.1001-7488.20141210.
[20]
高士增, 张怀清, 刘闽, 等. 基于点云的树木枝干形态参数提取技术[J]. 东北林业大学学报, 2014, 42(4):109-114.
GAO S Z, ZHANG H Q, LIU M, et al. Morphological parameters extraction of tree branches based on point cloud[J]. J Northeast For Univ, 2014, 42(4):109-114.DOI: 10.3969/j.issn.1000-5382.2014.04.025.
[21]
吴谦, 张怀清, 陈永富, 等. 杉木形态三维可视化模拟技术研究[J]. 林业科学研究, 2010, 23(1):59-64.
WU Q, ZHANG H Q, CHEN Y F, et al. Study on visual simulation technology of Cunninghamia lanceolata morphological characters[J]. For Res, 2010, 23(1):59-64.DOI: 10.3969/j.issn.1004-731X.2007.21.027.
[22]
朱念福, 张怀清, 崔泽宇, 等. 基于空间结构的杉木枝下高可视化模拟研究[J]. 南京林业大学学报(自然科学版), 2022, 46(1):51-57.
ZHU N F, ZHANG H Q, CUI Z Y, et al. Visual simulation of Chinese fir under branch height in consideration of spatial structure[J]. J Nanjing For Univ (Nat Sci Ed), 2022, 46(1):51-57.DOI: 10.12302/j.issn.1000-2006.202010037.
[23]
崔泽宇, 张怀清, 左袁青, 等. 杉木三维模型各方向枝下高分布研究[J]. 南京林业大学学报(自然科学版), 2022, 46(1):81-87.
CUI Z Y, ZHANG H Q, ZUO Y Q, et al. The distribution of under branch heights in various directions of the three-dimensional Chinese fir model[J]. J Nanjing For Univ (Nat Sci Ed), 2022, 46(1):81-87.DOI: 10.12302/j.issn.1000-2006.202110017.
[24]
COTÉ J F, WIDLOWSKI J L, FOURNIER R A, et al. The structural and radiative consistency of three-dimensional tree reconstructions from terrestrial lidar[J]. Remote Sens Environ, 2009, 113(5):1067-1081.DOI: 10.1016/j.rse.2009.01.017.
[25]
黄洪宇, 陈崇成, 邹杰, 等. 基于地面激光雷达点云数据的单木三维建模综述[J]. 林业科学, 2013, 49(4):123-130.
HUANG H Y, CHEN C C, ZOU J, et al. Tree geometrical 3D modeling from terrestrial laser scanned point clouds:a review[J]. Sci Silvae Sin, 2013, 49(4):123-130.DOI: 10.11707/j.1001-7488.20130418.
[26]
刘清旺, 李世明, 李增元, 等. 无人机激光雷达与摄影测量林业应用研究进展[J]. 林业科学, 2017, 53(7):134-148.
LIU Q W, LI S M, LI Z Y, et al. Review on the applications of UAV-based LiDAR and photogrammetry in forestry[J]. Sci Silvae Sin, 2017, 53(7):134-148.DOI: 10.11707/j.1001-7488.20170714.
[27]
张兴邦, 胡滨, 汤亮, 等. 基于改进包围盒树和 GPU 的水稻群体叶片间快速碰撞检测[J]. 农业工程学报, 2018, 34(1):171-177.
ZHANG X B, HU B, TANG L, et al. Fast collision detection for rice leaf population based on improved bounded box tree and GPU[J]. Transactions of the Chinese Society of Agricultural Engineering, 2018, 34(1): 171-177.

基金

中国林业科学研究院资源信息研究所基本科研业务费专项项目(CAFYBB2019SZ004)
国家自然科学基金项目(32071681)

编辑: 孟苗婧 郑琰燚
PDF(4010 KB)

Accesses

Citation

Detail

段落导航
相关文章

/