3D 盒子上统一生成点
我想在由 (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.
Any suggestions are appreciated.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
或交替地
更均匀(即不太随机),但只要密度足够高,每条边有超过几点
or alternately
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