3D 盒子上统一生成点

发布于 2024-08-29 07:32:12 字数 202 浏览 4 评论 0原文

我想在由 (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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

闻呓 2024-09-05 07:32:12
  1. 随机选择一侧按面积加权< /a> (备用链接这个 ...)
  2. 从均匀分布中随机选择一个点在那一侧,
  3. 起泡,冲洗,重复。

或交替地

  1. 决定点的密度
  2. 用一组随机的点依次填充每条边,这些点的密度

更均匀(即不太随机),但只要密度足够高,每条边有超过几点

  1. Select a side at random weighted by it's area (spare link or this one ...)
  2. Place a point randomly selected from a uniform distribution on that side
  3. Lather, rinse, repeat.

or alternately

  1. Decide on the density of points
  2. Populate each side in turn with a random set of points having that density

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文