在 3d 网格中转发(绘制)线 [英] forwarding (drawing) line in 3d grid

查看:38
本文介绍了在 3d 网格中转发(绘制)线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要类似 Bresenham 算法的东西,但是不完全和 3d 网格空间.

I need something like Bresenham algorithm but not quite and for 3d grid-space.

我需要 3d 单元格网格(边缘尺寸 1.0)从 S 点开始并前进到 K 点接触"线接触的所有单元格(即使只有边缘点被触摸了,我需要触摸所有 8 个单元格).

I got 3d grid of cells (edge size 1.0) need to start in point S and advance to point K 'touching' all the cells the line touches (even if only edge point is touched I need to touch all 8 cells).

需要用它来遍历写入值到单元格或从单元格中读取值并需要它尽可能快地管理(它将是大规模的使用每帧绘制数百万条这样的 3d 网格线).

Need to use it for traversal writing values to the cells or reading values from the cells and need it to be as fast as manageable (it would be in massive use of drawing millions of such 3d grid lines per frame).

有人能说它长什么样吗?

Could somebody say how it could look like?

推荐答案

考虑使用 Woo 和 Amanatides 网格遍历算法:文章 "快速体素遍历算法..."

Consider using of Woo and Amanatides grid traversal algorithm: article "Fast Voxel Traversal Algorithm..."

实际实现在此处的网格遍历部分

二维案例说明:

这篇关于在 3d 网格中转发(绘制)线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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