统一的新一代三维盒子点 [英] uniform generation of points on 3D box

查看:181
本文介绍了统一的新一代三维盒子点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想生成由它(疯丫头,MINY,minz)和(MAXX,MAXY,maxz)角点定义的3D盒随机点。我想产生一个随机点的盒子内,然后以某种方式投射到它的盒子侧面之一。但是,我并没有明确的平面信息的框边和这似乎是它不会产生因为如果盒子的一些侧面是比其他的大,那双方应该对他们产生了更多的点,点的均匀分布。

任何建议都是AP preciated。

感谢。

解决方案
  1. 选择是随机的一侧<一个href="http://stackoverflow.com/questions/2140787/select-random-k-elements-from-a-list-whose-elements-have-weights">weighted通过它的面积(备用链路或的这个 ...)
  2. 将来自均匀分布随机选择的一个点上侧
  3. 车床,漂洗,重复。

或交替

  1. 在决定点的密度
  2. 填充依次两边各一组随机具有密度点

这是更均匀的(即随机的),但是看起来细只要密度足够高的每一侧有超过少数点的

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.

解决方案

  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

这篇关于统一的新一代三维盒子点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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