使用 Blender 进行物理模拟

发布于 2024-11-16 07:13:41 字数 339 浏览 3 评论 0原文

我一直在寻找创建某种物理模拟的不同方法。我想做的是对身体在各种力的作用下随着时间的推移的运动进行 3D 建模。我最初考虑使用物理引擎(Bullet)和 3d 引擎(Irrlicht)在 C++ 中编写一些东西。然而,我注意到 Blender 已经允许人们进行物理模拟,因为 Bullet 已与它集成(如果我错了,请纠正我)。这看起来会让我更容易按照我想要的方式设计模拟(使用 Blender 的扩展 GUI)。

我的问题是,我想使用模拟结果(基本上是每个时间步的身体的 x、y、z、俯仰、滚动、偏航)来输入 c/c++ 代码(或其他语言,如果它更容易实现)这)。这可以用 Blender 完成吗?有没有我忽略的更好的软件包?谢谢,任何建议表示赞赏。

I've been looking at different ways of creating a certain physics simulation. What I am trying to do is to 3D model the motion of a body under the effects of various forces over time. I was originally looking at coding something in c++ using a physics engine (Bullet) and a 3d engine (Irrlicht). However, I noticed that Blender already allows one to do physical simulations since Bullet is integrated with it (correct me if I'm wrong). This seems like it would make it much easier to design the simulation exactly how I want it (with Blender's extensive GUI).

My issue is that I would like to use the results from the simulation (basically x,y,z,pitch,roll,yaw of the body at each timestep) for input into c/c++ code (or another language if its much easier for this). Can this be done with Blender? Is there a better software package for this that I am overlooking? Thanks, any advice is appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

爱你不解释 2024-11-23 07:13:41

我将使用 Python 脚本来完成该任务,因为 Blender 有一个很好的界面,可以通过 .py 文件以编程方式获取/设置对象及其属性。

因此,完成动画后,您可以调用脚本来遍历帧并将所需的数据保存到文件中。

可以在此处找到入门文档:http://wiki.blender。 org/index.php/Doc:Manual/Extensions/Python 或此处:http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro

有一个巨大的脚本列表值得浏览,以查找您需要的类似例程。 http://wiki.blender.org/index.php/Extensions:2.5 /Py/脚本

I would use a Python script for that task, as Blender has a nice interface getting/setting the objects and their properties programmatically through .py files.

So after you are done with your animation you can call a script to walk through the frames and save the required data into a file.

A getting started doc can be found here: http://wiki.blender.org/index.php/Doc:Manual/Extensions/Python or here: http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro

There is a huge list of scripts worth browsing for similar routines you need. http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts

追风人 2024-11-23 07:13:41

正如之前提到的,使用 python 来实现这一点是非常容易的。对于使用 Blender 的更具体用途,也许您应该咨询主 Blender 论坛 www.blenderartists.org

Blenderartists python 支持:http://blenderartists.org/forum/forumdisplay.php?11-Python-Support

Blender 2.5 代码片段(脚本简介对于 Blender 2.5): http://blenderartists.org/forum/showthread.php?193908-Code-snippets.-Introduction-to-Python-scripting-in-Blender-2.5x

As mentioned before, it would be very easy to use python for this. For more specific use if using Blender, perhaps you should consult the main Blender forum www.blenderartists.org

Blenderartists python support: http://blenderartists.org/forum/forumdisplay.php?11-Python-Support

Blender 2.5 code snippets (Introduction to scripting for Blender 2.5): http://blenderartists.org/forum/showthread.php?193908-Code-snippets.-Introduction-to-Python-scripting-in-Blender-2.5x

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