Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Physics question...

Author
Message
Zeal
23
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 2nd Sep 2003 12:56
Im trying to do a realistic pendulum swing in 3d. I tryed using a method that calculated a point on a 2d plain that was always being 'sucked' back to the middle, then 'mapped' that coord to a 3d sphere. Worked ok but still didnt feel right. I know there has to be a better way, im guessing using angles and forces (momentum, gravity, ect...).

Thanks in advance for any info

All you need is zeal
Scraggle
Moderator
23
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 2nd Sep 2003 14:59
Galileo discovered that the swing of a pendulum is isochronic. That is that for a given length and a given weight each full oscilation of the pendulum will take exactly the same length of time!

That might not help you much but it is what I remember from school (it was a long time ago) so I thought I would show of a bit.

Anyway since you are considering using proper physics and not just 'faking the physics' you might want to try here http://scienceworld.wolfram.com/physics/Pendulum.html

I hope it helps.

Nine lives to choose from and I get stuck with this one!
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 2nd Sep 2003 15:11
You can model it yourself using my node physics theory.

You need to model the swinging bit of the pendulum using x,y,z speed vectors. So if the pendulum is at rest, just give it some speed in the x axis to start it swinging.

In your loop you'll need to:
-Move the base of the pendulum by it's x,y,z speeds.
-Using the line between the object and the hinge of the pendulum, move the object back towards the hinge so that it's the correct distance away.
-Set the x,y,z vector speeds to the difference in the new pendulum base position and the old pendulum base position.
-Add a gravity force to the y speed (i.e. deduct a value from the y speed)

That should do it nicely. It works really well for all rigid body physics, and a pendulum should be no exception. In essense you're moving an object by it's speed, putting it back to the position it should be in the rigid body (based on its new position), then resetting the x,y,z speeds based on this final movement. It's worked a treat so far for all my physics needs.

Insiiiiiiiiiiiiiiiiiiiiiiiide!
Philip
23
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 2nd Sep 2003 17:11
This is an easy one.

The correct physics equation is:

alpha(t) = theta(t) = - (mgL) / I sin theta(t)

where a pendulum of mass m is suspended from a rod of length L and theta(t) is the angle formed with the vertical direction and I is the moment of inertia of the mass.

That means small oscillations of the pendulum have an angular frequency j given by

j = sqrt(mgL / I)

Am I the only one around here who didn't sleep through my GCSE physics classes, hmm?

And I'm a bear. You humans should be better at this stuff than me.

Phil

What do you mean, bears aren't supposed to wear hats and a tie?
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 2nd Sep 2003 22:13
I'm sure philip is throwing up the right equation here, but you can model it this way as well, and it'll do the same job. Here's the source. Easy as baking babies in ovens.



Insiiiiiiiiiiiiiiiiiiiiiiiide!
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 2nd Sep 2003 23:27
Here's a more interesting version of that code:



Insiiiiiiiiiiiiiiiiiiiiiiiide!
Zeal
23
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 3rd Sep 2003 03:18
Hey thanks for the good info everyone. Im off to go digest it all, but looks like everything I need is right here. Ill be back if I have anymore questions.

Thanks again

All you need is zeal
mR n
23
Years of Service
User Offline
Joined: 25th Jun 2003
Location:
Posted: 3rd Sep 2003 06:02
Quote: "Easy as baking babies in ovens."


lets try not to refer to the cooking of human beings.... it's a tad frightening. wouldn't "easy as abc" work just as well? but then again im not a sadistic fetus cooker....

***yes, this post was random but so was your comment***
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 3rd Sep 2003 15:01
Apparently you can eat the placenta. Will that do?

Insiiiiiiiiiiiiiiiiiiiiiiiide!

Login to post a reply

Server time is: 2026-07-23 15:49:42
Your offset time is: 2026-07-23 15:49:42