在 3D 框上均匀生成点 [英] uniform generation of points on 3D box
问题描述
我想在由 (minx, miny, minz) 和 (maxx, maxy, maxz) 角定义的 3D 框上生成随机点.我正在考虑在盒子内部生成一个随机点,然后以某种方式将其投影到盒子的一侧.但是,我没有盒子侧面的明确平面信息,这似乎不会产生均匀分布的点,因为如果盒子的某些侧面比其他侧面大,则这些侧面应该生成更多点.
I would like to generate random points on a 3D box defined by its (minx, miny, minz) and (maxx, maxy, maxz) corners. I was thinking of generating a random point inside of the box and then somehow projecting it onto one of the box sides. However, I don't have explicit plane information for the box sides and this seems like it will not produce a uniform distribution of points since if some sides of the box are bigger than others, those sides should have more points generated on them.
感谢任何建议.
谢谢.
推荐答案
或者交替
- 决定点的密度
- 用一组具有该密度的随机点依次填充每一侧
它更均匀(即随机性更小)但看起来不错,只要密度足够高,每边都有多个点
which is more uniform (i.e. less random) but will look fine as long as the density is high enough for each side to have more than a handful of points
这篇关于在 3D 框上均匀生成点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!