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 tha开发者_JAVA技巧t it is because I am using the PyODE world coordinates within VPython. Would this in the circumstance I described cause any kind of problems?
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.
精彩评论