turning car wheels?

hey everyone,
im trying to write a script that will make a car’s wheels turn the right number of times based on the distance of the car’s path and the circumference of the wheel.
-i dont know if this information is accesible in blender
-just wondering if anyone has any general suggestions?

ah, rotating forward/backwards

not turning left/right [with ankerman], because we all know [sarcasam] that it can be setup with some crazy constraint track to setup. [actually, it can, it looks cool]

as for rotating objects, I would have suggested the play NLA along path method, but your wheels are probably the child of an object on a path, so unless you create a path for each of the wheels it will not really work.

well anway, I guess you would have to merely find the position on the last frame, find how it is different from the current one [along the axes of the wheel?], and then rotate the wheel accordingly

… sounds interesting, because I don’t know how blender would allow you to access the previous frame’s position without actually changing the frame, checking, then changing back.

[will framechanged scriptlinks, like the one you would use to run such a script be called [particularly the one the script that initated the frame change from] when a python script changes the frame?]

… definitely some things to think about

Unless the car is moving ver-r-ry slowly, let’s be honest: the rotation of the wheel is simply a blur. I don’t see this particular attempt at hyper-realism translating to a marketable payback for the cost and effort invested.

What abput a car starting up?

You can look at both the scripts linked to in this thread:



thanks you guys, new question tho
for finding the length of a path, i am trying to use the ‘getPathLen’ method of the ‘Curve Data’ class. i was trying

import Blender
from Blender import Curve

cur = getCurveLen('Curve')
print cur

can anyone tell me why this isnt working?
(the print part is just for me to see the length)

I wrote a script that did this not too long ago but it also calculated the direction the wheel should be pointing. I still havn’t had time to make the good ui that I want.

you use the “regestry” to save and retrieve variables between runs of the script.

You also need to get the global position of the wheel instead of the normal LocX…Y…Z which does not change if the wheel is a child of a car.

I always wanted to try getting the diameter of the wheel by finding the longest edge in the objects bounding box I havn’t tested that though.

if you need help or examples let me know