Author Topic: Rigid Body Experiment  (Read 2221 times)

0 Members and 1 Guest are viewing this topic.

Offline Tetra

  • DBF Aficionado
  • ******
  • Posts: 2532
  • Karma: 83
  • Pirate Monkey!
    • View Profile
Rigid Body Experiment
« on: March 09, 2007 »
I got a new :inspired: for the 20s Compo.

Without giving anything away I thought i'd give out a taser. I actually quite enjoyed throwing this square about and thought some my appreciate the same I did.

I've spent the whole day looking at different explinations, all unfortunately math heavy, which i'm not to great on. So I gave up a drew a picture of the problem and came up with this.
Its a bit buggy at the moment and the box seems to have an amazing ability to balance its self on its edge. But I think this is mainly down to the collision detection as I havent yet interpolated ( is that a word :? ) one frame to another to detect the actual time of collision. Also my torque calculations are not entierly exactly what they shuold be. But that doesnt matter :)

My final release will have the full sorce included but for now here an exe

 :cheers:


« Last Edit: February 01, 2008 by Tetra »
Challenge Trophies Won:

Offline rdc

  • Pentium
  • *****
  • Posts: 1495
  • Karma: 140
  • Yes, it is me.
    • View Profile
    • Clark Productions
Re: Rigid Body Experiment
« Reply #1 on: March 09, 2007 »
Nice one. Looks quite realistic.

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: Rigid Body Experiment
« Reply #2 on: March 10, 2007 »
looks spot on to me cant wait to see the final source

Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4381
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Rigid Body Experiment
« Reply #3 on: March 10, 2007 »
Very cool and runs smooth. I am always fascintated by a good physics routine.
Keep it going...
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17378
  • Karma: 497
  • evil/good
    • View Profile
    • My Homepage
Re: Rigid Body Experiment
« Reply #4 on: March 10, 2007 »
That's cool :) I'd love to see this with a few dozen bouncing around and off of each other!
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Paul

  • Pentium
  • *****
  • Posts: 1490
  • Karma: 47
    • View Profile
Re: Rigid Body Experiment
« Reply #5 on: March 10, 2007 »
Very good :)
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17378
  • Karma: 497
  • evil/good
    • View Profile
    • My Homepage
Re: Rigid Body Experiment
« Reply #6 on: March 11, 2007 »
Found this Daf, don't know if it is any good though...

Hope it helps!

Rigid Body
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Tetra

  • DBF Aficionado
  • ******
  • Posts: 2532
  • Karma: 83
  • Pirate Monkey!
    • View Profile
Re: Rigid Body Experiment
« Reply #7 on: March 11, 2007 »
Thanx for the encouragment :)

Nice 1 for the link Nick, I will have a look and see if I can make head or tails of it.

Unfortunately I dont think I will be able to get it working how I want for the compo, but, i'll see if I can fake it for that  :diablo:  :updance:

Problem with what you seen is that its is based on the basic equations for force, acceleration and torque but, my understanding is somewhat rusty, and many sites are just too mthematical for me, so I need to brush  up on some maths :(
The code is very specific for the example too, so i I increased the mass for example the whole thing went crazy.

Problem too with code is that no one ever seems to just program a simple box lol, thay have to have loads of boxes with springs, strings complex collisions etc, so I find it hard to follow.

So I scrapped what I had done and started again, but now, the simulation is gaining far too much or far too little energy, wich is a bit annoying. Also i'm not sure how to convert torque to actual rotational velocity in terms of derees per millisec. The result should be radians per second, but it doesnt seem to be.
I've now also included a time based system, and my next goal will be to have some global variable to scale the physics to the pixels on the screen to some relative amount to real life, so gravity actually looks like gravity in the world.

I'll post some code and what I know very soon, maybe some of you will be able to help me accomplish what I set out to do, and maybe we can all learn some cool things from it :)

In th end I want to make it 3D how cool would that be!

 :cheers:
Challenge Trophies Won: