Omnimaga

General Discussion => Technology and Development => Computer Programming => Topic started by: Builderboy on September 28, 2009, 12:20:41 am

Title: Rigid Body Dynamics
Post by: Builderboy 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!
Title: Re: Rigid Body Dynamics
Post by: DJ Omnimaga 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)
Title: Re: Rigid Body Dynamics
Post by: Builderboy 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.
Title: Re: Rigid Body Dynamics
Post by: DJ Omnimaga 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.
Title: Re: Rigid Body Dynamics
Post by: TsukasaZX 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 :)
Title: Re: Rigid Body Dynamics
Post by: JoeyBelgier on September 28, 2009, 01:37:38 pm
/me 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
Title: Re: Rigid Body Dynamics
Post by: Eeems 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...
Title: Re: Rigid Body Dynamics
Post by: cooliojazz on September 28, 2009, 11:52:12 pm
Nice Builderboy, thats an awesome engine.
Title: Re: Rigid Body Dynamics
Post by: Builderboy 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.
Title: Re: Rigid Body Dynamics
Post by: DJ Omnimaga 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
Title: Re: Rigid Body Dynamics
Post by: Builderboy 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.
Title: Re: Rigid Body Dynamics
Post by: Eeems 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
Title: Re: Rigid Body Dynamics
Post by: DJ Omnimaga 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
Title: Re: Rigid Body Dynamics
Post by: Builderboy 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
Title: Re: Rigid Body Dynamics
Post by: DJ Omnimaga 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)
Title: Re: Rigid Body Dynamics
Post by: Builderboy on October 02, 2009, 07:26:10 pm
Mmm thats probably it.  Greenfoot has a speed issue with displaying images.  I believe they are working to fix it but who knows :/

I updated the newer version to Omnimaga, maybe you should try it in case it is the applet problem.  And did the framerate thing help?
Title: Re: Rigid Body Dynamics
Post by: DJ Omnimaga on October 02, 2009, 08:17:01 pm
I haven't tried yet, I'll prbly try later tho