How would animate rack gears with spur gears in blender?
Use Transformation constraint to convert rotational to transnational motion.
Could you post a screenshot of how to use transformation constraints?
I want the gear to rotate as i pull it over the rack gear’s gear teeth?
I guess you can adjust it by trial and error, but if you want it to be accurate, first know the circumference of the gear (circumference = diameter*pi). Say it’s 25 units long, and say the rack moves 10 units. 10 is 40% of 25, so the rotation of the gear needs to be 40% of 360° = 144. Using the transformation constraint, you can say that for every 1 unit the rack moves, the gear will rotate 14.4 degrees. Do not forget to check “extrapolate” so that the constraint applies beyond those bounds.
I hope I didn’t screw up in my train of thought there.
Hadrien
Edit
Here is an example file with the transformation constraint : http://www.pasteall.org/blend/23568
As AlanK noted, you can also use a driver, the numbers are the same anyway !
You could try adding a driver for the rotation of the pinion so that its rotation changes with its distance from the rack, and then change the numbers in the polynomial equation to get the rotation to match.
How do you add drivers?
Right click on the transform to which you want to add a driver and select add driver.
Mr Builder, you need to search these things for yourself… they are well-documented ! When you’re stuck and none of your attempts to solve the issue been rewarded, you’re more than welcome to ask for help.
If want to use a driver… and are going to use the Gear to drive the Rack… then decide what rotation axis the Gear is going to rotate on just as AlanK is showing you to do… However the Rack is what is going to be Driven… so the Driver needs to be placed on one of the Racks location channels… (not on the Gear)…
To open up drivers is a bit tricky… first open a new view port… then bring up the Graph Editor in that new viewport…
Then along the bottom tool bar you will find the word… “F-curve Editor” click on that and select ‘Drivers’… now your in the Driver editor…
On the left hand side you should see your driver that you created select it then you will need to hit ‘N’ to bring up the left Right hand tool bar for messing with Drivers…
In that tool bar you will find the properties box for Drivers… under where it says “Add variable” find “Ob/Bone” and browse to your Gear… then set the transform channel… X Rotation(or what ever channel your using)…
note that the name of your transform channel expression is ‘var’ by default… you can rename it if you want… (but lets not for this example…
Finally under where it says ‘Scripted Expression’ type in ‘var’ …
Hit the update dependencies button and your driver should work…
test it by grabing your gear and rotating it on the axis you chose in the driver…