Author Topic: Rigid Body Dynamics  (Read 8075 times)

0 Members and 2 Guests are viewing this topic.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Rigid Body Dynamics
« on: September 28, 2009, 12:20:41 am »
I have been programing in java for quite some time, and it was only recently that I realized I could share many of my projects here on this site! 

This is a Physics Engine I have been working on for many months.  it is based off of my soft-body engine, which for some reason is significantly easier :P  Anyways, I host all my java creations on a site called the Greenfoot Gallery, a place where you can upload java program created with the program Greenfoot.

This is my physics engine

http://greenfootgallery.org/scenarios/925

As you can see it only supports 1 object so far, but i am currently working on supporting collisions.



And for those of you who are worried that I am giving up calculator programing, never fear!  I have been doing this java programing for nearly as long as I have been programing in TiBasic, and it hasn't overridden it yet!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Rigid Body Dynamics
« Reply #1 on: September 28, 2009, 12:24:05 am »
I like it, also you had nice other stuff there too. I hope you finish some of them. Try to upload in zip file, tho, since it's the standard on our site.

And yeah staff can share non calc stuff too and even post in the archives, since we're not 100% calc related ^^ (see for example how I got my old games here)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Rigid Body Dynamics
« Reply #2 on: September 28, 2009, 12:28:08 am »
Alright, I fixed it :) Its really not necessary to download it from Omnimaga though, as GreenfootGallery allows you to play it in Browser :P

i hope to update this though, as it would be very useful for my and other people's games.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Rigid Body Dynamics
« Reply #3 on: September 28, 2009, 12:41:53 am »
Well, I could always allow that (have a link to play in browser located in download description). I would probably need to create a HTML page, tho, to be able to play it there. If the arcade allows java games, it could also be an option, altough the arcade requires 50 posts.

No matter what, the audience would still increase toward your games, though.

Offline TsukasaZX

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 415
  • Rating: +46/-3
  • Never Gonna Give You Up!
    • View Profile
Re: Rigid Body Dynamics
« Reply #4 on: September 28, 2009, 01:25:57 am »
That is one sweet rigid body engine, Builderboy. I wish I learned cool stuff like this in Java class. Say, you should make one of those "beat up the figure" games where you can drag and bash and beat up a figure (stick figure? AOL guy?) with physics and stuff :)
IRC EFNet | Nick Su-Hime | Chan #omnimaga, #unss, #cemetech
Yumé - 100% Complete!
Yumé 2: Rika's Story - 10%
 - Hiatus until summertime
Yumé: The Eternal Dreams - 50%
 - World and events
TIBiC/GO C Library - N%

"Alenda lux ubi orta libertas" - Let learning be cherished where liberty has arisen.

  ▲
▲ ▲ Triforce!

Offline JoeyBelgier

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 545
  • Rating: +25/-21
  • Joey
    • View Profile
Re: Rigid Body Dynamics
« Reply #5 on: September 28, 2009, 01:37:38 pm »
* NecroF-_-ckk thinks the same as TsukasaZX :D

btw; that figure of Linerider would be cool too :P
EDIT: i just had some fun with it by making the block only collide with the left and right wall and stuff
it'd make a nice game since I'm already amused with it :p
« Last Edit: September 28, 2009, 01:41:02 pm by NecroF-_-ckk »

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6266
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Rigid Body Dynamics
« Reply #6 on: September 28, 2009, 07:34:18 pm »
hmm, I like it, kind of reminds me of when I was playing around with Blender3D
which reminds me...I should play around with it again...
/e

Offline cooliojazz

  • Support Staff
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 619
  • Rating: +66/-9
  • I omnoms on your soul
    • View Profile
    • Unreal Phantasies
Re: Rigid Body Dynamics
« Reply #7 on: September 28, 2009, 11:52:12 pm »
Nice Builderboy, thats an awesome engine.
Spoiler For Random signess:
You can not beat my skills.
Trust me.
So don't even try.
And remember never to trust someone who says, "Trust me."

TI File Editor Progress: Remade in java like a boss. 50% we'll call it? IDK =P
Java Libraries: JIRC - 90% JTIF - 5%
TI Projects: Unreal Notator - -5000%
Nomcraft, a Bukkit mod
Some of the music I write can be found here | The Rest Should Be Here (Bandcamp)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Rigid Body Dynamics
« Reply #8 on: September 29, 2009, 12:29:19 am »
:D I'v been working on getting objects to interect, but I'm taking abreak to work on Serenity some more.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Rigid Body Dynamics
« Reply #9 on: September 29, 2009, 02:26:38 am »
Yay, glad to hear you're going back on Serenity ^^

I was getting worried about that project x.x

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Rigid Body Dynamics
« Reply #10 on: October 01, 2009, 06:03:15 pm »
Update!

http://greenfootgallery.org/scenarios/925 !

I have been working off and on, bit I've finally managed to get Object collisions working!  Currently there are 3 mode for playing around with the 2 boxes.

1)Box: Allows you to drag a single box with a rubber band attached to a corner
2)Drag: You can drag around boxes and throw them.  My favorite, but make sure not to crush the other boxes!!
3)Dice: Attaches rubber bands to both Boxes so you can hang them over your dashboard :P

Drag is currently the most glitchy, but only if you try to throw the boxes really fast at each other or crush them against the walls.  They all have certain problems as well, so if the simulation freezes, press Q and then press Restart.

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6266
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Rigid Body Dynamics
« Reply #11 on: October 01, 2009, 06:18:41 pm »
wow, that looks great! can't wait for more updates!
that glitch is actually really funny :P
/e

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Rigid Body Dynamics
« Reply #12 on: October 02, 2009, 12:17:31 am »
Nice, but one question:

would it be possible to allow the user to choose the framerate (15, 30 and 60, for example)? Because on my PC, your java applets hangs every 5 seconds or so (during about 0.5-4 seconds) and it takes extreme CPU ressources

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Rigid Body Dynamics
« Reply #13 on: October 02, 2009, 10:20:47 am »
Hmmm, thats interesting...  What are your hardware specs?

I added a feature that allows you to change the framerate and simulation speed.  When changing the framerate, it will take more time to do the same operations each fram, and when changing the speed, it will do less calculations each  frame, but the framerate should stay the same.

Press F to switch between 3 framerates
Press S to switch between 3 Speeds

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Rigid Body Dynamics
« Reply #14 on: October 02, 2009, 05:35:58 pm »
Intel Celeron 2.93 GHz, 1 GB of RAM, 80 GB harddrive. The major issue comes with the graphic card I think (old PCI (not express) ATI Radeon 9250+ 128 MB)