PDA

View Full Version : Locomotive piston

 pixelchemist03-13-2006, 04:23 AMSo this weekend was the first weekend I have had in a long while where i could just hang around and do nothing... let me tell you... such a great weekend... but anyways i took some of that time to try polish up my cinema skills in areas that are lacking... in doing so i came across this link... http://www.base80.com/index.php/2006/02/18/cs_as_bs what caught my attention is that it says it cant be done with targeting... but i couldnt see why... so i set out to do it with targeting instead of the Math approach he took there... my result is this Quicktime (1.33Mb) (http://www.nathanielcurrier.com/qt/piston_linkage2.mov) and i feel i have gotten it pretty close... but i cant seem to get the pivot for the piston to linkage to not slide slightly as like it does there... so i got me thinking that this was the reason he said it couldnt be done with targeting... but im not sure... how i did it is wheel has the linkage attached and there is a null used as a target in the knuckle on the piston... then there is a null at the nuckle but as a child of the linkage... and a simple xpresso that sets the z position of the piston to the same as the z position as the null in the linkage... and then when the wheel is rotated it works 90% except the sliding that you see in the quicktime... so i guess my question is... was the math approach used in the tutorial to fix this sliding thing or was it for something else...
bobtronic
03-13-2006, 04:53 AM
so i guess my question is... was the math approach used in the tutorial to fix this sliding thing or was it for something else...

yes, it fixes the sliding. the problem is the movement of piston is linear but the linkage moves in a trigonometric way. you have to do some sin/cos calculations to get it right.

Bob

Per-Anders
03-13-2006, 05:18 AM
dunno, should be pretty simple all in all.

put the rod as the child of your wheel.

make it's axis at the pivot point on the wheel.

put a null object as the child of the rod, and put it at the other and (at the second pivot point).

make your second rod, and set it's pivot point at the position of the pivot on it

add a target tag on the first rod, pointing at the second rod.

make an expresso network for the second rods global x (or z dependong in which way your system is built) to link to the nulls x (or z).

animate the wheel spinning.

done.

bobtronic
03-13-2006, 08:51 AM
Per, I had problems to get your solution to work. I think this is because one object drives another. For instance when I rewind the scene it messes all up.

Here is my try on this problem. It's a pure trigonometrical approach.

loco.mov (http://www.bobtronic.de/files/misc/loco/loco.mov)

and here the scenefile:

loco_scene (http://www.bobtronic.de/files/misc/loco/loco.zip)

another nice sideeffect is that the whole loco engine can be rotated and moved.

Bob

Per-Anders
03-13-2006, 08:59 AM
really? no problems here, attached the sample scene file.

bobtronic
03-13-2006, 09:10 AM
really? no problems here, attached the sample scene file.

well this is the same as I tried first but it blows apart with fast rotations and you have to use high expression priorities. I found my solution a bit more elegant :)

cheers,
Bob

base80
03-13-2006, 03:48 PM
Well I think my calculated method is absolutely exact and works.
I tried all kind of smart targeting and never figured out how to connect the one to the other without the sliding problem.
However there is a more complex solution that works with Sine and trigonometry and that one is much more flexible in use.

CGTalk Moderation
03-13-2006, 03:48 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.