Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 8 of 8

Thread: physics engine

Hybrid View

  1. #1
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421

    physics engine

    Hi,

    I have been thinking about writing a rudimentary physics engine (rigid body perhaps). I could make it public if people are interested.

    Trouble is, I dont have any experiences with commercial API's. I'm interested in seeing some API documentation.

    Most importantly, I would like to ask what kind of an interface would you require. There are pretty complex issues, such as how to deal with the objects (mathematical models or mesh models)

    Can some people here share their experiences?

    V-man
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,704

    Re: physics engine

    This has been done 100 times before.

    Try MAGIC at http://www.magic-software.com/ or perhaps the ODE stuff at http://

    There's a decent set of links at http://www.codercorner.com/Links_Programming.htm

    Note that most of these libraries listed (even the free ones) have thousands of hours of design, work and debugging gone into them already. If you're starting from scratch, it might be very interesting and educational for your own benefit, but the world is better served if you pick one of the existing projects and help it move forward instead.
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

  3. #3
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421

    Re: physics engine

    First, thanks jwatte for responding. That is a excellent link and seems as if I had saved it somewhere.

    Magic software is a set of algorithms, but I havent seen a physics engine in there. Im not talking about how to do collision detection algorithms, but a package that can handle the physics of a scene with gravity and various material properties like friction.

    I was looking through the links, but didnt see anything I like yet. Do you know of a specific library for which you would give a high rating.

    And certainly, I dont mind joining other people's project, as long as it's incomplete

    V-man
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Sep 2000
    Location
    SWEDEN
    Posts
    718

    Re: physics engine

    I think jwatte meant to give you this link but it got lost in cyberspace.

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,704

    Re: physics engine

    Thanks harsman. I did indeed. Useful, yet incomplete -- a perfect fit :-)
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

  6. #6
    Junior Member Regular Contributor
    Join Date
    Nov 2002
    Location
    Los Angeles, CA
    Posts
    208

    Re: physics engine

    Fast, efficient, accurate, robust collision detection is the only hard part about a physics engine.

  7. #7
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    San Diego, CA, USA
    Posts
    769

    Re: physics engine

    Really? I find collision resolution and dealing with stiff springs to be more challenging than the actual collision detection. Maybe we should work together

    -- Zeno

  8. #8
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421

    Re: physics engine

    ODE seems a little better. Using a search engine is fine, but what can beat a human search engine?

    Fast acurate collision detection is only of a physics engine. That's really the first step, but Im not looking for code that does that since I already have some. Magic Software is a good example. Just take that and optimize the hell out of it.
    I started out by getting rid of the OO stuff and already I was getting much better numbers. Then rearrange a bit. Got me 2.5 to 3 times better numbers. Then do SIMD (didnt do this yet). I think Magic Software never benchmark their stuff.

    Im also considering other phenoma like smoke diffusion, destructable objects, liquids and so on.

    V-man
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •