| Topic: |
Science > Physics |
| User: |
"" |
| Date: |
26 Mar 2007 09:40:41 PM |
| Object: |
physics demo |
I made a physics demo of a bouncing cube:
http://www.coolgroups.com/bouncingcube/cube.exe
The source is at:
http://www.coolgroups.com/bouncingcube/cube.zip
Please let me know what you think.
.
|
|
| User: "Androcles" |
|
| Title: Re: physics demo |
27 Mar 2007 07:23:05 AM |
|
|
<bob@coolgroups.com> wrote in message =
news:1174963241.189124.25590@y66g2000hsf.googlegroups.com...
I made a physics demo of a bouncing cube:
=20
http://www.coolgroups.com/bouncingcube/cube.exe
=20
The source is at:
=20
http://www.coolgroups.com/bouncingcube/cube.zip
=20
Please let me know what you think.
Very good for a first try.=20
Trivially, what I don't like is that you called it a cube and=20
it plus the universe it contains is rectangular, so it distorts.
Glancing through your code this does not seem to be your
intention, so use a square display window. That should be a=20
fairly minor fix.
One of the purposes of doing such simulations is to answer
"What if?" type questions.=20
What if there were no gravity?
What if I bumped the outside shoebox?=20
What if the shoebox were spinning?
What if there were a point source of gravity (a so-called
mythical black hole) in orbit outside the shoebox, could
we observe the bouncing ball and determine the behaviour
of the invisible influence from the behaviour of the ball?
Well, that last might be going overboard, but you get the idea.
To answer those I'd like to see a combo box of initial conditions
that the user can modify.
Initial x-position:=20
Initial y-position: =20
Initial z-position:=20
Initial x-velocity:=20
Initial y-velocity:=20
Initial z-velocity:
Initial x-acceleration: =20
Initial y-acceleration:=20
Initial z-acceleration: =20
Initial pitch-angle:=20
Initial roll-angle: =20
Initial yaw-angle:=20
Initial pitch-rate:=20
Initial roll-rate: =20
Initial yaw-rate:=20
Initial gravity:
The code for this will be useful to you when you later model aircraft, =
for example. Doing the groundwork now will put you in good stead for
later simulations of more complex situations, and re-using old proven=20
code in new situations is the mark of an efficient software engineer.
Two other extremely minor points... The left and right walls
of the shoebox both appear to be black, and the ball drops
below the front window which appears to be smaller than
the wall of the shoebox.
I do like your code, it is excellent and highly readable.
If I can help you in any way, email me at
Androcles01@blueyonder.co.uk.
.
|
|
|
| User: "YBM" |
|
| Title: Re: physics demo |
27 Mar 2007 08:05:08 AM |
|
|
Androcles a écrit :
<bob@coolgroups.com> wrote in message news:1174963241.189124.25590@y66g2000hsf.googlegroups.com...
I made a physics demo of a bouncing cube:
http://www.coolgroups.com/bouncingcube/cube.exe
The source is at:
http://www.coolgroups.com/bouncingcube/cube.zip
Please let me know what you think.
Very good for a first try.
Only Androcles and Wilson are stupid enough to run a .exe downloaded
from a unstrustable web site...
.
|
|
|
|
|
| User: "John C. Polasek" |
|
| Title: Re: physics demo |
27 Mar 2007 09:47:28 AM |
|
|
On 26 Mar 2007 19:40:41 -0700, wrote:
I made a physics demo of a bouncing cube:
http://www.coolgroups.com/bouncingcube/cube.exe
The source is at:
http://www.coolgroups.com/bouncingcube/cube.zip
Please let me know what you think.
No cube, just black square
.
|
|
|
| User: "Androcles" |
|
| Title: Re: physics demo |
27 Mar 2007 11:11:03 AM |
|
|
"John C. Polasek" <jpolasek@cfl.rr.com> wrote in message =
news:fjbi03lv5d60n7onhg70jgui7v9ia6vdld@4ax.com...
On 26 Mar 2007 19:40:41 -0700, wrote:
=20
I made a physics demo of a bouncing cube:
http://www.coolgroups.com/bouncingcube/cube.exe
The source is at:
http://www.coolgroups.com/bouncingcube/cube.zip
Please let me know what you think.
No cube, just black square
Sounds like you don't have enough colours on your display.
.
|
|
|
| User: "John C. Polasek" |
|
| Title: Re: physics demo |
28 Mar 2007 09:18:37 PM |
|
|
On Tue, 27 Mar 2007 16:11:03 GMT, "Androcles"
<Engineer@hogwarts.physics.co.uk> wrote:
"John C. Polasek" <jpolasek@cfl.rr.com> wrote in message news:fjbi03lv5d60n7onhg70jgui7v9ia6vdld@4ax.com...
On 26 Mar 2007 19:40:41 -0700, wrote:
I made a physics demo of a bouncing cube:
http://www.coolgroups.com/bouncingcube/cube.exe
The source is at:
http://www.coolgroups.com/bouncingcube/cube.zip
Please let me know what you think.
No cube, just black square
Sounds like you don't have enough colours on your display.
I checked: 32 bit color and tried highest resolution 1600 something,
still no action. Maybe a special program is needed. I have never
failed to display any video though.
John Polasek
.
|
|
|
| User: "Androcles" |
|
| Title: Re: physics demo |
29 Mar 2007 05:03:11 AM |
|
|
"John C. Polasek" <jpolasek@cfl.rr.com> wrote in message =
news:mc8m03pgmlpsg7iibp3ji66q2ilu3sloei@4ax.com...
On Tue, 27 Mar 2007 16:11:03 GMT, "Androcles"
<Engineer@hogwarts.physics.co.uk> wrote:
=20
"John C. Polasek" <jpolasek@cfl.rr.com> wrote in message =
news:fjbi03lv5d60n7onhg70jgui7v9ia6vdld@4ax.com...
On 26 Mar 2007 19:40:41 -0700, wrote:
=20
I made a physics demo of a bouncing cube:
http://www.coolgroups.com/bouncingcube/cube.exe
The source is at:
http://www.coolgroups.com/bouncingcube/cube.zip
Please let me know what you think.
No cube, just black square
Sounds like you don't have enough colours on your display.
I checked: 32 bit color and tried highest resolution 1600 something,
still no action. Maybe a special program is needed. I have never
failed to display any video though.=20
John Polasek
Ok, well... you have a problem that I do not share. Bob's=20
bouncing cube has some minor display flaws in that it is=20
stretched horizontally and never bounces as high as the top=20
of the screen, nor can the user resize the window, but he's=20
made a very good effort for a first attempt. I'm hoping to
see some neat stuff from this lad, he's showing talent.
.
|
|
|
|
| User: "" |
|
| Title: Re: physics demo |
29 Mar 2007 12:19:48 AM |
|
|
On Mar 28, 6:18 pm, John C. Polasek <jpola...@cfl.rr.com> wrote:
On Tue, 27 Mar 2007 16:11:03 GMT, "Androcles"
<Engin...@hogwarts.physics.co.uk> wrote:
"John C. Polasek" <jpola...@cfl.rr.com> wrote in messagenews:fjbi03lv5d60n7onhg70jgui7v9ia6vdld@4ax.com...
On 26 Mar 2007 19:40:41 -0700, wrote:
I made a physics demo of a bouncing cube:
http://www.coolgroups.com/bouncingcube/cube.exe
The source is at:
http://www.coolgroups.com/bouncingcube/cube.zip
Please let me know what you think.
No cube, just black square
Sounds like you don't have enough colours on your display.
I checked: 32 bit color and tried highest resolution 1600 something,
still no action. Maybe a special program is needed. I have never
failed to display any video though.
John Polasek
What OS are you running?
.
|
|
|
|
|
|
|

|
Related Articles |
|
|