闫秋羽 张兴刚 郝冬冬

摘  要: 针对交互型虚拟现实室内场景建设以及人物漫游问题,提出一种基于改进二叉树BSP的室内场景管理方法,并采用遗传算法实现该场景下的人物路径规划。首先,在基于几何建模法的虚拟漫游系统中,利用改进的二叉空间剖分BSP树算法对三维场景进行预处理,从而提高实时图形绘制的效率;然后,对漫游场景进行栅格化处理,并采用遗传算法实现两点间最短漫游路径的计算。室内场景漫游测试结果表明,相比传统的A*算法,提出的BSP?遗传漫游算法在耗时和最短路径长度两方面均表现出一定的优势。

关键词: 室内场景管理; 虚拟现实技术; 三维场景预处理; 实时图形绘制; 路径规划; 漫游技术

中图分类号: TN02?34; TP391.41                     文献标识码: A                  文章编号: 1004?373X(2019)19?0095?03

Abstract: An indoor scene management method based on improved binary tree BSP is proposed, and the genetic algorithm is used to realize the path planning of the character in the scene, so as to solve the problem of interactive virtual reality indoor scene construction and character roaming. The improved binary space split BSP tree algorithm is used in the virtual roaming system based on geometric modeling method to preprocess the 3D scene, which is beneficial to the improvement of the real?time graphics rendering efficiency. The roaming scene is rasterized, and the genetic algorithm is used to calculate the shortest roaming path between two points. The indoor scene roaming test results show that the proposed BSP?genetic roaming algorithm has more obvious advantages in both time?consuming and path length in comparison with the traditional A* algorithm.

Keywords: indoor scene management; virtual reality technology; 3D scene preprocessing; real?time graphic rendering; path planning; roaming technology

0  引  言

随着虚拟现实技术的不断发展,各种行业中应用虚拟现实技术的场景越来越多。虚拟现实技术不仅应用在航空、航天等特殊领域,更应用在现实生活中,例如,虚拟游戏、真实3D电影、三维室内漫游等,为用户营造出一种身临其境的感觉[1]。

虚拟漫游技术是虚拟现实技术中的一项基本功能。为了不断增加用户的真实感,虚拟现实系统的图形分辨率质量和三维场景复杂度也随之不断提高,以便提供较好的逼真度。因此,如何采用先进的场景处理方法构建室内场景中的三维模型,以及通过路径规划实现场景内人物的交互成为一个很重要的研究方向。文献[2]对沉浸式三维虚拟漫游技术进行了研究,提出基于Multigen Creator和3DMAX的虚拟城镇场景建模方法,并通过二叉空间剖分BSP树在Vega软件中实现虚拟场景中的人物漫游交互。文献[3]提出一种三维巷道场景中虚拟漫游路径优化技术,该方法根据OpenGL视点变换模型原理,在BSP树基础上实现视点追踪,并结合线性分形插值函数和Cardinal曲线拟合算法,对追踪路径进行优化。文献[4]提出基于滑动窗口和A*算法的四足机器人路径规划方法。但是,BSP树算法的计算复杂度较大,在处理复杂场景时效率会有所降低。同时,新型智能化路径规划算法也不断出现,遗传算法解决栅格地图上的最短路径求解问题时,具有较好的求解质量和效率[5]。因此,在以上研究的基础上,本文提出一种基于改进二叉树BSP的室内场景设计方法,并采用遗传算法实现该场景下的人物路径规划。首先,利用球体树原理构造粗略、模糊的空间分割法,从而使基于二叉树BSP算法的三维漫游场景构造速度得到加快;其次,对漫游场景进行栅格化处理,并采用遗传算法实现该场景下的人物路径规划,得到最短漫游路径。测试结果验证了提出漫游方法的优越性能。

[6] 吴晓雪,王魏,李响,等.基于osgEarth虚拟校园漫游的研究[J]. 现代电子技术,2017,40(20):18?21.

WU Xiaoxue, WANG Wei, LI Xiang, et al. Study on virtual campus roaming based on osgEarth [J]. Modern electronics technique, 2017, 40(20): 18?21.

[7] BASTUG E, BENNIS M, MEDARD M, et al. Toward interconnected virtual reality: opportunities, challenges, and enablers [J]. IEEE communications magazine, 2017, 55(6): 110?117.

[8] WALSH C M. Assessment of competence in pediatric gastrointestinal endoscopy [J]. Current gastroenterology reports, 2014, 16(8): 1?10.

[9] LEE N Y, LEE D K, SONG H S. Effect of virtual reality dance exercise on the balance, activities of daily living, and depressive disorder status of Parkinson′s disease patients [J]. Journal of physical therapy science, 2015, 27(1): 145?152.

[10] SONG B, WANG Z, SHENG L. A new genetic algorithm approach to smooth path planning for mobile robots [J]. Assembly automation, 2016, 36(2): 138?145.

[11] MAPLES?KELLER J L, BUNNELL B E, KIM S J, et al. The use of virtual reality technology in the treatment of anxiety and other psychiatric disorders [J]. Harv rev psychiatry, 2017, 25(3): 103?113.

[12] QU B, ZHANG Z, LI F, et al. Research and application of oil operator training system based on virtual reality technology [J]. Journal of Petrochemical Universities, 2017, 30(1): 54?59.