forwarding (drawing) line in 3d grid

女生的网名这么多〃 提交于 2019-12-17 14:35:52

问题


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

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).

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?


回答1:


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

Practical implementation is in grid traversal section here

2d-case illustration:



来源:https://stackoverflow.com/questions/25016603/forwarding-drawing-line-in-3d-grid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!