Rotation based on the time slider

I would like to add a new attribute to the channel box that would control the rotation of an object based on the time slider. For example as a car increases in speed I would like the rotation of the wheels to increases. If the car decreases, the rotation of the wheels would decreases.

i'm not sure i understand the question. do you want the rotation of the wheels to be based on the car's speed, or the timeline???

if you want rotation to be based on speed, then you're going to have to look into the frameCache node i think. either that or write some nasty mel based expressions...

but have a look in the docs about the frame cache node. it basically stores the values for an attribute offset in time. you could use that to store the previous frame's translation, and then write an expression that subtracts that from the current translation, and determines a velocity, which you can get speed from.

or just set the rotation based on the translation of the cars "main body"

wheel rot = car.translation / (2*pi*wheel radius)*360 if I remember correctly

Thank you for your reply. I was over thinking the problem, for some reason I got it in my head that I had to base the rotation on the time line. I completely over looked the fact that I could base it on the translation.

i'm confused. basing an objects rotation "on the timeline" is just a weird way of saying keyframe it... after all, setting a key is just saying at time x, make sure you're at rotation y...

Any thing I could say would just add up to inexperience. Basically long ago I had a bad idea in my head before I knew better and now my inexperience let that bad idea clouded my judgment.

After reading your first reply I smacked my self on my head, and asked my self what was I thinking? Thank you again and hopeful I won

oh ma, sorry, i didn't mean to make you feel bad, or rub your nose in it... i was just wondering if i had missed something. which lets face it, seems to happen more regularly than i'd like.

anyway, glad its all sorted.
cheers!

It