Advertisement

ode tutorials or docs?

Started by December 12, 2004 05:22 PM
3 comments, last by codeandroid 19 years, 8 months ago
hello all!! does anyone know where I can find documentation or tutorials for the open dynamics engine, apart from the 17 samples and the user's guide that come with the distribution?
You'd be better off figuring it out on your own.

Just remember these things:
- Use dHashSpaceCreate to create your space.
- When starting out, don't bother actually loading models or anything, just use the primitive objects they supply you with till you figure it all out (you can find all of them for rendering by using the functions ODE supplies you with).
- Attach joints, THEN set the appropriate data (confused the hell out of me).
- Collision detection's the main part to all of this. use the callback function from something else till you feel you're ready for it.
- ALWAYS use dWorldQuickStep (if you use dWorldStep, the best thing you can hope for is your models to explode, but it's more likely to crash).

Start with something small, like a box in the middle of the screen. Try rotating it, applying forces, etc. Then add the plane for it to sit on (this is where the collision detection comes into play).

If you can't figure out how to rotate the objects from the matrices (for rendering), have a look at http://www.j3d.org/matrix_faq/matrfaq_latest.html (I found it helpful). As for actually rotating the objects, I used dQFromAxisAndAngle for each of the 3 rotations (1 per axis), then multiplied them together (dQMultiply2), then rotated the object using dBodySetQuaternion. Probably not the best way to do it, but it works.

Once you get the box to sit down, add another one, above it, and slightly offset, so it'll fall onto the other one, and *should* roll off. Then you can move onto joints.

If you want to jump in the deep end (like me), you can make a humanoid model (out of the primitive objects, nothing too special yet). Remember, the more detail you put into it, the more coding you'll have to do (I've got 330 lines for my 17-piece humanoid).

After that, you can add breakable joints (dJointSetData is there for a reason) and other things (water/mud/etc. (dBodySetData) can be implemented into the collision detection, but it's the same as the humanoids; the more complex you make it, the more coding you'll have to do).
Advertisement
Quote: Original post by Anonymous Poster
(...) Remember, the more detail you put into it, the more coding you'll have to do (I've got 330 lines for my 17-piece humanoid). (...)

Use a data-driven approach to modelling :) Less coding, more modelling, exporting and loading. The tools exist.

-codeandroid
I'm not a moddeler though, I'm a programmer. I find it easier to write 300+ lines to define how 1 humanoid should look, bend, and break, than actually taking the time to make it from scratch. Once I add rotation and mass (it has a mass, but it's based on the individual sizes of each part, not as a whole) to it, it'll be complete. Once that's done, I'll be able to use 1 line of code to create any humanoid creature of any size. Seems easier than writing code to convert a model to the objects ODE uses, especially since I can use what I've already got, and render a model in it's place. ;)
I'm not saying you should 'convert' it. Just define it in a physics-based modeller, save it and load it into the application. There are various tools and engines out there that use this approach, commercial and non-commercial. At least two of such tools are available for use with ODE.

Furthermore there are tools which can derive a 'ragdoll'/'humanoid' of pretty good quality from a skinned 3d models with skeletons.

Quote: I find it easier to write 300+ lines to define how 1 humanoid should look, bend, and break, than actually taking the time to make it from scratch.

Well, you're creating it from scratch, aren't you? Whether you do it in code or in a modeller (not necessarily a 'graphics' modeller, can be a 'physics object' modeller).

I'm a programmer, too. But I find it more practical to use a graphical editor to tweak a value, save the file and reload this into the application than spending the time to recompile parts of the project and restarting the application.

But whatever suits you best is fine with me, hehe :)

-codeandroid

This topic is closed to new replies.

Advertisement