找回密码
 注册
Simdroid-非首页
查看: 157|回复: 4

[图形图像] 请教如何在一立方体中随机生成一定数目互不重叠的球或圆柱体

[复制链接]
发表于 2010-3-7 16:13:49 | 显示全部楼层 |阅读模式 来自 北京海淀
请教如何在一立方体中随机生成一定数目互不重叠的球或圆柱体。主要是互不重叠的限定,谢谢!
发表于 2010-3-7 16:34:25 | 显示全部楼层 来自 上海
Simdroid开发平台
1. Generate some random points, ( E.g. sphere = center points + radius )
2. Store them in the Memory
3. Check If they are overlapping, If overlapping, delete those points
4. Add some new random points and refresh the memory.
5. Check you have enough points ?  -> If  True, go end. If False, go 4.
6. End

Points 3 should be difficult. you can start from 2D as a circle. them go 3D sphere.
回复 不支持

使用道具 举报

 楼主| 发表于 2010-3-7 20:15:58 | 显示全部楼层 来自 北京海淀
谢谢版主的指点!试试看
回复 不支持

使用道具 举报

发表于 2010-3-7 20:20:09 | 显示全部楼层 来自 上海
验证是否重叠比较困难,可以先有个程序,当考虑边界情况和判别是否可行。
回复 不支持

使用道具 举报

发表于 2012-1-12 20:56:53 | 显示全部楼层 来自 浙江金华
简单的可以用Distance测试,如空间比较大,球数量较少的情况就好做些,留名
复杂的话就像碰撞检测啥的一些算法一样去搞啦。
回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-4-24 16:06 , Processed in 0.044355 second(s), 14 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表