Newton's cradle

Share with us how are you using the powerrrr of the force

Moderator: Alain

Newton's cradle

Postby Sascha Willems » Fri Apr 01, 2005 12:33 pm

This one mostly was created out of boredome. Some days ago I sat in front of my PC and somewhere saw a picture of a Newton's cradle and thought "why not try to build such a thing using Newton?" and so I did. Here is the end result (click for bigger shot) :

Image Image

Download it here (ZIP, ~1 MByte)

Basic usage :
As in most of my other demos you can pick and drag around the balls using and holding down the left mouse button. So pick one of the balls and try to "throw" him out of the case and then let if fall down onto the other balls.
Thr right button (when hold down) is used to rotate the scene, mouse wheel zooms in and out.
If you don't move the mouse for ~2 seconds, the cursor dissapears and the scene starts to rotate. So if you just want to watch the physics, speed up some (or one) balls(s) and don't move the mouse for 2 seconds.
Pressing Escape quits the demo. For more info please see the readme.

Please also note that the stencil shadows slow the demo down very hard, so if it's too slow press 's' to disable the shadows.

P.S. : The newton's cradle is not 100% perfect, nor is it as effective (the balls slow down too fast I think) as one of those real things (sadly I have no real Newton's cradle). So if someone thinks he knows how to make it better, just post your hints.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby Stucuk » Fri Apr 01, 2005 1:02 pm

Nice demo. You could make it into a screensaver if the balls were automaticaly "thrown" when the speeds became too low.
User avatar
Stucuk
 
Posts: 800
Joined: Sat Mar 12, 2005 3:54 pm
Location: Scotland

Postby _Tux_ » Fri Apr 01, 2005 2:13 pm

thats pretty cool :) how long did it take to make?

also i think the balls fall correctly
_Tux_
 
Posts: 81
Joined: Wed Sep 08, 2004 10:38 am
Location: UK

Postby Sascha Willems » Fri Apr 01, 2005 2:30 pm

Doing the graphical stuff (models, coding shadow-volumes, reflections, etc.) only took me around one hour. Most of the time (dunno, maybe 10 hours or so) I spent on figuring out what joint(configuration), what masses, what material parameters etc. to use.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby Alain » Fri Apr 01, 2005 6:59 pm

This is the best Newton Cradle implementation I have seen so far. This is material for the download page :D
Alain
Site Admin
Site Admin
 
Posts: 28
Joined: Sun Sep 28, 2003 2:33 am
Location: Miami

Postby Julio Jerez » Fri Apr 01, 2005 7:31 pm

Dude I really, really like this demo. Believe or not, it is very hard to simulate a Newton cradle that shows near perfect transfer of momentum. Most physics engines use the trick of placing the balls with a small gap between them to achieve the effect. Only engines with a correct solver can do it.
Julio Jerez
Moderator
Moderator
 
Posts: 10954
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Postby walaber » Sat Apr 02, 2005 5:31 am

very cool demo!! it seemed very realistic to me, and the graphics were beautiful (as usual) :D :D
Independent game developer of (mostly) physics-based games. Creator of "JellyCar" and lead designer of "Where's My Water?"
User avatar
walaber
Moderator
Moderator
 
Posts: 393
Joined: Wed Mar 17, 2004 3:40 am
Location: California, USA

Postby Braxton » Sat Apr 02, 2005 4:09 pm

That was very cool. The only thing I didn't like was the shadows. If you moved way far away you can see the shadows of the bals and they are very large (and see out of place as if the Newton Cradle was 10X bigger than it really is). All in all very effective. I liked it a lot.
-Braxton

Be sure to check out the A6 / Newton wiki (for people who use both or just one) at http://www.3dphysicswiki.tk
User avatar
Braxton
 
Posts: 1
Joined: Fri Mar 25, 2005 7:11 pm

Postby Stucuk » Sat Apr 02, 2005 7:22 pm

If im correct the mirrored effect caused mirrored shadows which screwed with the "normal" shadows.
User avatar
Stucuk
 
Posts: 800
Joined: Sat Mar 12, 2005 3:54 pm
Location: Scotland

Postby Sascha Willems » Sun Apr 03, 2005 5:07 am

No, I don't use shadows in the mirror (would slow it down even more). The fact that the shadows seem so big comes from my light position which maybe is too near (not like in real life, where it is far away).
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby Stucuk » Mon Apr 04, 2005 11:32 pm

if u move the camera so its under the mirror bit ull notice the walls are lit perfectly fine. only when its moved above the mirror does another shadow seem to appear which inverts the correct shadows.
User avatar
Stucuk
 
Posts: 800
Joined: Sat Mar 12, 2005 3:54 pm
Location: Scotland

Postby Sascha Willems » Tue Apr 05, 2005 4:10 am

Could you please post a screenshot? Maybe that's a problem on NVidia cards, since I as of now have only ATI-hardware to test my demos/games on. I know that the shadow looks a bit unusual cause of the near position of the light source, but it at least should look correct.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby Stucuk » Tue Apr 05, 2005 8:44 am

User avatar
Stucuk
 
Posts: 800
Joined: Sat Mar 12, 2005 3:54 pm
Location: Scotland

Postby Sascha Willems » Tue Apr 05, 2005 12:17 pm

Thx for the screenshots. That's not how the shadows should look like and is clearly a rendering problem. Now I need to find out what's going wrong in NVidia-cards.
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Postby Sascha Willems » Wed Apr 06, 2005 9:23 am

Would you be so kind and download this updated exe-file (~230KBytes) and tell me if the shadows work now?
User avatar
Sascha Willems
Moderator
Moderator
 
Posts: 346
Joined: Fri Aug 27, 2004 10:18 am
Location: Germany

Next

Return to User Gallery

Who is online

Users browsing this forum: No registered users and 1 guest

cron