统一的新一代三维盒子点 [英] uniform generation of points on 3D box
问题描述
我想生成由它(疯丫头,MINY,minz)和(MAXX,MAXY,maxz)角点定义的3D盒随机点。我想产生一个随机点的盒子内,然后以某种方式投射到它的盒子侧面之一。但是,我并没有明确的平面信息的框边和这似乎是它不会产生因为如果盒子的一些侧面是比其他的大,那双方应该对他们产生了更多的点,点的均匀分布。
任何建议都是AP preciated。
感谢。
- 选择是随机的一侧<一个href="http://stackoverflow.com/questions/2140787/select-random-k-elements-from-a-list-whose-elements-have-weights">weighted通过它的面积(备用链路或的这个 ...)
- 将来自均匀分布随机选择的一个点上侧
- 车床,漂洗,重复。
或交替
- 在决定点的密度
- 填充依次两边各一组随机具有密度点
这是更均匀的(即随机的),但是看起来细只要密度足够高的每一侧有超过少数点的
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.
- Select a side at random weighted by it's area (spare link or this one ...)
- Place a point randomly selected from a uniform distribution on that side
- Lather, rinse, repeat.
or alternately
- Decide on the density of points
- 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屋!