PDA

View Full Version : lookat constraint problem


nanjoutai
02-04-2005, 06:02 AM
i'm trying to animate a piston in 3ds max 7. i have a very basic setup, with a chamber, a rod, and, to keep things simple, a single hinge for the rod. the chamber has a lookat constraint set to the rod hinge, and the rod has a lookat constraint set to the chamber. the rod's pivot point is coincident with the rod hinge, and the rod is connected to the rod hinge in the schematic view.

here's a screenshot of a simple test scene i created, which works perfectly:

http://brooksfredrikson.com/cgtalk/piston1.jpg

[this pic shows two hinges, but it works correctly with the rod looking at either the chamber's hinge or the chamber itself]

as you can see above, i've moved the hinge on the right up (the hinges started out aligned horizontally), and the chamber (left) and rod (right) have rotated accordingly. all is good and perfect.

however, i've tried to apply this to a mech i'm working on, and the rod is being distorted whenever i move the hinge on an actual model. here's a screenshot:

http://brooksfredrikson.com/cgtalk/piston2.jpg

as you can see, the rod isn't rotated correctly, and the model itself is skewed a bit. the two environments are setup exactly alike, to the best of my knowledge. same structure, same links in the schematic view, pivot points set the same way....

if anyone has any suggestions on why this sort of thing would happen, please let me know.

thanks in advance

Kanga
02-04-2005, 10:59 AM
Just an idea. You might be able to do it with just bones.

Couldnt you link the piston bone as a child to the housing bone (the parent)? Not connected but linked. Go to link info on the piston bone and restrict all rotational axiss (lock) then restrict transform axis for all except the one that will let you slide the piston. Then the housing will move, drag the piston along and you can slide the piston on the one axis you need.

Hope this helps.

PEN
02-04-2005, 01:44 PM
Have you non-uniformaly scaled any of the objects in the rig or hierarchy? This will cause skewing.

nanjoutai
02-04-2005, 05:36 PM
PEN,

Thank you! I scaled the rod non-uniformely, and that makes perfect sense. Any way to reset the scaling parameters but maintain its present size and shape?

Thanks again!

And Kanga, good info. I don't think it would suit this scenario in the way that I'm looking to make it work, but I can use that system elsewhere for sure. Thanks!

nanjoutai
02-04-2005, 05:58 PM
So I've figured out how to reset the scale of an object, and I still have the problem. Not sure if it's because something else is wrong, or because if it's a "damage has already been done" sort of thing. Any suggestions?

nanjoutai
02-04-2005, 06:59 PM
Fixed the problem. Turns out, the hinge was faulty. I noticed the problem when I unlinked the piston rod from the hinge, it worked perfectly. I deleted the hinge and recreated it, and now all is well. Sweet!

Thanks all for your replies!

CGTalk Moderation
02-04-2006, 07:00 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.