Jump to content

Photo

Pendulum


  • Please log in to reply
4 replies to this topic

#1 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 24 June 2009 - 01:47 PM

Okay, I have a request for a very simple script request. I just need a script for a pendulum that wings back and forth. Something like in this video: http://www.youtube.c...h?v=-ymnNVJW7Qg Thanks to whoever does it.

Edited by Russ, 24 June 2009 - 01:47 PM.


#2 L33TSkillz

L33TSkillz

    Junior

  • Members

Posted 25 June 2009 - 07:34 AM

There is a parabola script, by slowing it down the closer it gets to certain x positions with a low arced parabola, it should mimic a pendulum.

#3 Joe123

Joe123

    Retired

  • Members

Posted 01 July 2009 - 09:40 AM

Are you after it slowing down at the top of the swing too?

Seeing as SHM is accurately defined, it shouldn't be too difficult.

#4 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 08 July 2009 - 09:59 PM




I *think* this should work:

CODE

float x = 0;
float y = 0;
float angle = 0;
float speed = 3; // or stuff
float norm = 0.2; // ...n stuff

angle += speed - Abs(Sin((angle + speed)) * speed) + Abs(Cos((angle + speed))) + norm;

x = anchor_x + Sin(angle) * dist;
y = anchor_y + Abs(Cos(angle)) * dist;
        



PARABOLA BEAM!!

#5 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 09 July 2009 - 01:07 PM

Thanks Gleeok! I'll try that out.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users