pygame 与 VPython 可视化 PyODE

发布于 2024-09-10 02:24:59 字数 148 浏览 4 评论 0原文

我制作了一个类似于第二个 PyODE 教程的程序,但使用 VPython 而不是 pygame,并且删除了用于更改坐标的 coord 函数。它可以工作,但球体和关节的定位不正确。我猜测这是因为我在 VPython 中使用 PyODE 世界坐标。在我描述的情况下,这会导致任何问题吗?

I made a program similar to the second PyODE tutorial but using VPython instead of pygame and I removed the coord function for changing coordinates. It works but the locating of the spheres and joints isn't correct. I am guessing that it is because I am using the PyODE world coordinates within VPython. Would this in the circumstance I described cause any kind of problems?

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

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

发布评论

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

评论(1

离不开的别离 2024-09-17 02:24:59

There is a reimplementation of pyode tutorial #2 which marries pyode with VPython included in the visualpyode library available at mission cognition. The solution used by that library is to use the ode coordinate system and orientations and copy them to the visual objects/frames (pos, axis, up) for each iteration, using the pyode quaternion to rotate local axis (1,0,0) and up (0,1,0) vectors into world coordinates. There are a few more subtleties involved so the best thing to do is grab the source code and walk through it. Alternatively you could just build your sim using the merged API that visualpyode provides and skip all the details.

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