Sandy 3D:利用物理原理创建房间
我想知道是否有人可以帮助我开始在 Sandy 3D 中创建房间。 我知道我可以生成飞机,但我不确定如何实现简单的物理(即玩家无法穿过墙壁)。 有没有一种简单的方法可以做到这一点,或者我应该研究像WOW(Flash的3D物理引擎)这样的东西?
谢谢, 卡梅伦
I was wondering if anyone can help me get started with creating a room in Sandy 3D. I know I can generate the planes, but I am unsure as to how to implement simple physics (i.e. the player cannot walk through a wall). Is there a simple way to do this, or should I look into something like WOW (3D physics engine for Flash)?
Thanks,
Cameron
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果你只是想阻止玩家穿过墙壁,你可以考虑使用 2D Maths 来进行碰撞检测。
我用这种方法制作了一些 PaperVision 游戏,我的博客上有解释。
If you just want to stop the player walking through walls, you could consider using 2D Maths to do the collision detection.
I used this method to make some PaperVision Games, explained on my blog.
如果是第一人称系统,即你是摄像机,那么只需检查从摄像机到墙壁的距离,如果距离小于你预定的人的“胖度”,则不要朝那个方向移动(即通常会向前)。
如果您使用某种头像(第二人称/第三人称系统),Shape3d 对象有一个边界框,可用于碰撞测试。
If it is a first person system, i.e. you are the camera, then just check the distans from the camera to the wall, If the distans is less than your predetermined "fatness" of your person, don't move in that direction ( that'd normaly be forward ).
If you use some kind of avatar ( second/third person system ), the Shape3d object has a bounding box, that can be used for collision testing.