Adverti horiz upsell
Poly Mechanical Modelling
Poly Mechanical Modelling
sdb1987, added 2005-10-03 11:28:51 UTC 101,449 views  Rating:
(3 ratings)
Page 3 of 3

Using the image below (figure A) as a guideline, construct a piston. Make it as simple or complex as you want, the principle is the same.



Once you have something like the image above, make two groups. The first group has the Piston and Ball B in it. The second group has the Rod and Ball A in it. Parent the Sheath to the Rod. Move each groups pivot point to the end of the respective ball, centered, at the furthest exremity, as illustrated. Move the sheath's pivot center to the end closet to the Rod, as shown. Move the Rods pivot center to the middle of Ball A. Move the Piston pivot to the center of Ball B.

Next, select the Rod, then the Piston, and put an aimConstraint on it. Adjust the vector if necessary so it points at the piston. My settings were (0 , -1, 0 ). Repeat the procedure, picking the Piston first, then the Rod. The vectors were the opposite for the Piston (0, 1, 0). It should still look like the picture, however.... if you grab either group and move it, the two parts will always remain oriented at each other (See figure C). However, the Rod and Sheath aren't long enough. We'll get to that later.







Now you can move it to the body. It may look wierd as you drag each group, but position them where you want them, as long as they connect when they are in place. See figure D above. I made a makeshift cup for one end to sit in, and a slot in the shoulder for the other end to connect to.

The next step would be to connect the groups to the arm and body. After that, move the arm around and check it out. It works, but the piston and Rod get a fair bit away from each other, unless you translate the Sheath. And that is what we are going to do using the distance node.




If everthing is connected right, you should have something like shown above(figure E). If the arm lifts higher, the sheath comes OUT of the piston still. This we will fix next.



This will cover setting up the distanceDimension return value as a driver for the sheath's LOCAL scale and translation. Moving the sheath along it's local Y axis should make it move DOWN the Rod. Even moving it to the far edge of the Rod, when my arm was fully lifted, there was still a gap betwwen the Rod/Sheath and Piston. By scaling the Sheath on the Y axis as well, I could close the gap. But...... I needed some way to make this happen automatically as I moved and lifted the hand/arm.



Select the Sheath, and in the channelBox highlight the transX value. Right click on the value, and select setDriven key. This will open the 'setDriven key' window and load the sheath as the driven object.Under the windows options, pick 'load shapes'. Select the distanceDimension node in the outliner, and load it as the driver. A hude list of attributes will appear. Scroll to the bottom and the DISTANCE value is there. Pick it, and then pick the Sheath's transY and scaleY values. Set a key. This connects the Distance value with the transY and scaleY values of the Sheath.

Lift the hand/arm and move it to it's furthest point from the body. The DISTANCE value will now be higher. Move and/or scale the sheath until it is still over the Rod, and its far tip is just inside the Piston. Because we moved the Sheath's pivot center, it only scales in one direction... TOWARD the piston. Set a key on the Sheath's transY and scaleY values. Now when you lift the arm, the Sheath scales and translates automatically. I also moved the arm to it's closest point, and set another key scaling the 'PISTON' down slightly, so it didn't overlap the Rod too much. Now the distance nodes' VALUE drives the Sheath and the Piston lengths....... always keeping the two parts seemingly joined.






Hope this helps and works out. Feel free to offer any comments, critiques by sending me an Email.

Craig Daughtrey
slaughtr@travel-net.com