Still stuck on making a good pendulum...
NtG
Member Posts: 103
Hi, so the main part of my game involves a pendulum and i've looked through the pendulum and swinging demos but im still stuck on getting the pendulum to look normal rather than robotic. I want it to look like the pendulum here: http://myphysicslab.com/pendulum1.html but all of the demos i have seen just look to robotic like the pendulum doesn't slow down at it's peak. Any help would be appreciated.
I've posted similar discussions about 4 times, but i keep changing how i want the pendulum to act, and have never got it to work exactly how i would like.
Also, I looked for fire maple's hanging/swinging demo again, but cant find it.
I've posted similar discussions about 4 times, but i keep changing how i want the pendulum to act, and have never got it to work exactly how i would like.
Also, I looked for fire maple's hanging/swinging demo again, but cant find it.
Comments
http://speedy.sh/PqFjN/PendulumOrRope-2.zip
RThurman
http://speedy.sh/S7wVb/simplePendulum.zip
Hope this helps!
RThurman
Change Attribute: game.acceleration To: 10*( game.gravity/game.rodLength*sin(game.pendulumAangle ))
Here, I am multiplying the original equation by "10". (But but you can use any multiplier. Whatever feels about right.)
RThurman
Thanks for the background info about angular velocity. That explains a few things for me!
One way to figure out the fps would be the following:
Timer (every 0 seconds)
----Change Attribute self.myCounter To: self.myCounter +1
Timer (every 1 seconds)
----Change Attribute self.myFPS To: 2*self.myCounter
----Change Attribute self.myCounter To: 0
Display Text: self.myFPS
While it might not be completely accurate (my tests showed it could be off by as much as 2 fps), it might work for your purposes.
RThurman
http://speedy.sh/v28ar/YetAnotherChain.zip
By the way - I do agree with you about joints. While they are possible to do in GS -- having access to box2D joints will make all this so much easier!
RThurman
Change Attribute: game.velocity To: 1.001*(game.velocity+game.acceleration)
You can experiment with the '1.001' to get different rates of change.
Hope this helps
RThurman
RThurman
Change Attribute: game.velocity To: .99*(game.velocity+game.acceleration)
Anything above 1.0 and velocity swings it higher. Anything below 1.0 and it swings lower. (And of course exactly 1.0 puts it in perpetual motion.)
RThurman
Hi, could you please share this again, the link seems to have expired. I am trying to do a swing pendulum motion too.
I think that file is lost. Here is another one that might work for you.
http://www.mediafire.com/download/e3zg477cekl764j/simplePendulum.zip
thank you very much
also, i was hoping to make it look like a chain of links is attached to the nail, so looking for a kind of a wavy (rope like) effect on the rod while it swings