PDA

View Full Version : Pendelum motion

AlphaBeta
04-06-2003, 10:05 PM
Hi guys im sort of a newbie to this forum and this is my first thread so bear with me...

Ok, recently i got assigned a project from physics class, and to make a long story short, I ended up wanting to show the motion and swing of a pendelum in lightwave....I've been using it for a couple of months now, but I am not sure how exactly I should do this....I want it to look realistic and so it swings back and forth accelerating at the beginning and than slowing down and accelerating in the other direction.

I tried to simply keyframe the motion but it turned out very nasty..

If anyone knows any tricks on how to do this it would be VERY appreciated......thank you

Heimhenge
04-06-2003, 11:22 PM
You'll never get it to look good with manual key framing. Try using an expression for the motion. Here's an example you can play around with. Put the pendulum bob in the XZ plane. Parent it to a null located at the origin. Then use an expression like:

30*sin(2*PI*Time)

to drive the H-rotation of the null. The "30" tells you how many degrees it will swing to either side of rest, and the "2" factor adjusts the frequency of the swing.

If you want to scale this so that the pendulum length comes into play, you'll need to scale the expression for the acceleration due to gravity (9.8 m/s/s).

AlphaBeta
04-06-2003, 11:25 PM
so where do i put the expression in?

sorry...i'm not to familiar with scripts and all this animation stuff...I just know the basics....

Heimhenge
04-07-2003, 12:54 AM
Select the object you want to pendulate (like the null to which the pendulum bob is parented) and go to Graph Editor. Select the relevant Roation channel and add the expression.

You will find that, for physics type simulations, a mastery of the Graph Editor is essential. It's well worth your time to play around with this feature as it is one of the most powerful tools in LW.

AlphaBeta
04-07-2003, 09:41 AM
WOW!!! that works great, makes a very nice smooth motion...just what i was looking for!!!! thanks a lot...

one question though, assuming that the mass at the bottom of the string weighs say....0.5 kg and the string is 2 m long, how would I be able to input this information into the equation???

sorry about asking so many questions but I want it to look as realistic as possible...

thank you very much so far, youve been a great help!!

Heimhenge
04-07-2003, 10:01 AM
As you may have already learned from your study of pendula, the mass and size of the bob are irrelevant to the motion unless you want to factor in air resistance. That's why you don't find "m" in the equation for simple pendulum motion, i.e.,

T = sqr(4*PI^2*L/g) [where g = 9.8 m/s^2 on Earth]

If you want to make the pendulum realistically scaled, swinging as it would with its given length, then you'd have to tie the period T to this expression.

Cooler yet, for interactivity, put another null at the end of the pendulum, parent it to the bob, and express the length of the pendulum as the distance of that null from the origin. Then you could drag the pendulum length longer or shorter and watch the period change accordingly. Of course you'd need to be in Layout to make this happen ... not sure what your situation will be for the actual presentation.

You could also do this whole thing using LW's gravity feature, but for your purposes I think expressions will suffice (especially since you already know how to use them).

AlphaBeta
04-07-2003, 11:41 AM
wow....you've been an awesome help to me....the motion of it looks awesome now...

thanks alot for the help