与四叉树的连通图(寻路)

发布于 2024-10-20 01:56:11 字数 337 浏览 2 评论 0原文

我读了一些有关四叉树的内容,并且我正在尝试利用它们进行寻路。为此,我尝试使用四叉树创建一个连通图,其中每个“最小矩形”(无子节点)直接连接到其相邻的最小矩形。为了说明...如果您看一下 http:// 中的右下角矩形en.wikipedia.org/wiki/File:Point_quadtree.svg,该矩形是树中的无子节点,它应该直接连接到它周围的三个矩形,这也是无子节点。

创建四叉树非常简单,但我不确定如何检测与它的连接。谁能给我一些见解?

提前致谢!

I read some about quadtrees, and I am trying to take advantage of them for pathfinding. To this end, I am trying to use a quadtree to create a connected graph, where each "minimum rectangle" (a childless node) is directly connected to its adjacent minimum rectangles. To illustrate... if you take a look at the bottom-right rectangle in http://en.wikipedia.org/wiki/File:Point_quadtree.svg, that rectangle is a childless node in the tree, and it should be directly connected to the three rectangles surrounding it, which are also childless nodes.

Creating the quadtree is pretty easy, but I'm not sure how to detect connections with it. Can anyone offer me some insight?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吃不饱 2024-10-27 01:56:11

右下角的矩形只是相邻 3 个矩形的子级。当你站在顶部时,从上面看它就像一个金字塔,看看四叉树如何将空间递归地划分为 4 个方向。这是一个更好的解释 http://blog.notdot.net/2009/11/Damn-Cool-Algorithms-Spatial-indexing-with-Quadtrees-and-Hilbert-Curves

The bottom right rectangle is just a child of the adjacent 3 rectangle. Look from above at it like a pyramid when you are standing at the top and look how the quadtree divide the space recursivley into 4 directions. here is a better explanation http://blog.notdot.net/2009/11/Damn-Cool-Algorithms-Spatial-indexing-with-Quadtrees-and-Hilbert-Curves

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文