快轴对准单元遍历算法 [英] Fast axis aligned cell traversal algorithm

查看:161
本文介绍了快轴对准单元遍历算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  • 在给定轴排列的方形四格相同大小的划分,B,C和D。
  • 在给定一个线段由点S1将点S2。

什么是找到走过的部分(如有的话)的细胞的最快方式,排序遍历顺序?

What is the fastest way to find the cells traversed by the segment (if any), sorted by traversal order ?

在上面的例子中,正确的结果是:

In the example above, the correct results are :

  • 第1位:[D]。
  • 段2:[A,B]
  • 段3:[C,D,B]
  • 4段:[]
  • 段5:[C]

推荐答案

您可以尝试快速体素遍历算法光线跟踪由Amanatides和胡的。

这是意在应对大网格,但原则上可以为您的应用程序也非常有用。

It is intended to deal with big grids, but the principle can be useful for your application too.

这篇关于快轴对准单元遍历算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆