From: Matthias B. <ba...@ir...> - 2005-08-04 14:07:22
|
Paul Kinnane wrote: > 1) Initially I was using version 0.35 – which was running fine in the > python environment I’m using (which is part of a 3d app – which has a > Python22 interface). However I needed Trimeshes, so moved to version > 1.1, which does not work in the python environment, due to the > environment not defining True and False. Is there a way I can define > True and False before calling the ode methods? I tried setting ode.True > = 1 in my python app, however that didn’t work. Please try the following: ode.__builtins__.True = 1 ode.__builtins__.False = 0 > 2) The obvious solution to 1) is to recompile PyODE, changing the > True/Falses to 1/0’s. However, when I recompile, it is compiling within > including the ODE library (ie. It is requiring the ODE.DLL be present in > the python\lib\site-packages directory. You have to link against the static ODE lib. If you're using the ODE binaries then you have make sure to use one of the zip files that don't have the "-dll-" in their name. If you're compiling it yourself you have to make sure to compile a static library and link against this one instead of the import library for the dll. > Also, the resulting pyd doesn’t > work correctly. For example, recompiling PyODE0.35 results in my Y > cords being given as a result of body.getPosition. I'm not sure if I understand what you mean here.... has it something to do with mixing up the single and double version of ODE? > 3) I have some static objects in my scene. To keep them in place, I am > attaching those objects to ode.environment with a FixedJoint. The > objects are rotated (prior to the SetFixed call), however after a call > to world.step, body.setRotation returns an identity matrix (so the are > “un-rotating”). When did you attach the joints? It seems to work over here: from ode import * w = World() b = Body(w) # Set some rotation other than the identity... b.setRotation([0,-1,0, 1,0,0, 0,0,1]) print b.getRotation() # Attach the body to the environment... j = FixedJoint(w) j.attach(b, None) j.setFixed() # Do some simulation steps... for i in range(100): w.step(0.04) # See if the orientation has changed... print b.getRotation() For me, this program prints the same orientation twice. Cheers, - Matthias - |