Animating a trailer hitch

When I read all of these tutorials (http://bongo.rhino3d.com/page/inverse-kinematics), it did not occur to me how I can apply any of the concepts to the animation of a truck hitch (semi truck)

My goal is not to make the most complicated animation – something simple would do, but I don’t want to animate the path of the trailer and animate the rotation of the cabin. I can see how I could do that but I’m not sure whether it is the easiest way. Is it possible to do something with IK with no fixed constraints (as seen in the tutorials) but one moving constraint and a joint?

Is it possible to make the trailer follow the truck? or should I make the truck follow the path of the trailer? Sorry about asking so many questions… without having any previous experience in this it is unclear to me how to rig models and it does not come intuitively.

Can you please give some information on how the cabine is made moving. Is a Simple Constraint (e.g. Look Along Path) used? Where is his pivot situated - front wheel axis or rear or…? Maybe you can append a file showing the movement of the cabin.

Hello Luc,

Thanks so much for responding. The cabin is a group of meshes… but when I use the look along path constraint, the cabin smashes together:

The pivot is situated at the rear wheel axis (where the trailer mounts to the cabin).

I attempted as simplified version of my problem, and I think I am super close. However, I am using constrain to path for the the driver point (and this is problematic as I want to control how fast the point moves along the curve).

However, I am having a hard time setting the parent of the first point in the trailer to the last point of the cabin. If I set it as a parent, then everything falls apart. Right now, the cabin moves along the path perfectly. The trailer moves along it perfectly when it is dragged around with the mouse, but I cannot get the trailer point to be the child of the cabin point. I’m thinking that if I get the proxy objects to work, I could set the mesh geometry as the children of the proxy objects and it would work.

Right now I have two conceptual difficulties:
1 Why setting the trailer driver point as the child of the cabin trailing point doesn’t work.
2 How I can apply what I learned in this animation to a path where I can control the speed and movement of the rig. Can I do this by animating dragging the point to different parts of the curve, and setting it NOT to constrain to path but taking care of that myself by setting it to constrain to path(object) via IK?

Thank you so much for all your help

trailer 001.3dm (202.7 KB)

Firstly: your previous post: the ‘smashing together’ of your cabin is because, when you animate a group, every single member of the group is animated (given a pivot etc…). So all the meshes forming your cabin where drawn together with their pivots at the same location on the path curve.
You should rather make a Block (Rhino’s Block command) of composite object. The block then when animated only gets a single pivot.

Your attempt on the simplified version is deservingly.
Setting the trailer as child of the cabin in your ‘trailer 001.3dm’ model doesn’t work mainly because parent child relations are based upon the object’s base-positions, i.e. their position apart from any animation. In the left figure below you see your objects as such. In order to get things working at least the various objects must be in there ‘logical’ mutual place (right figure).

This model Track 001.3dm (96.5 KB) shows you a way of setting up the proper IK-chain.

Controlling the speed and movement of a constrained-to-path-object can be done by adding keyframes defining the ‘parameter’ of the constraint. An example: Track.3dm (59.7 KB)

Good luck,
Luc

Hello Luc,

Thank you so much for your help. The block suggestion is genius, and what you did with the blocks in the track 001 example I thought was also genius – you were able to simulate wheels by blocking them together and placing the pivot on the path. I was sucessfully able to replicate it.

I guess order of operations matters here – you have to parent the objects first, and then set the constraints. Is it possible to do it in reverse order?

I see what you mean about the parameter of constraints. I was able to see your explanation here after knowing what to look for: http://bongo.rhino3d.com/forum/topics/object-along-path-with-varying-heading-and-speed

Thank you so much! I will report back once I have the animation done.

Hello Luc,

I successfully applied your advice and now I have a truck which follows the path perfectly and as I want it.

I have one last question though and I think I will be done with my animation. I have a shipping container box which has a lot of animation which has already been previously done to it. If I keyframe and move it up and then make it a parent of the trailer (to simulate the loading of the container onto the truck), all of the animation done previously will fall apart. I am wondering if I should start a new animation from this point and composite the two together, or if there is a solution to this problem.

Thank you so much for all your help

What I meant, concerning you model ‘trailer 001.3dm’, was that the cabin is no longer on his original place when you attached (made child) the trailer, because the cabin was displaced as the result of the active Simple constraint (To Path). At the time an object is made child his pivot’s position in regard to his parent’s pivot is recorded. The commands BongoSelectChildren as well as BongoSelectParent have an option ‘SnapIntoPlace’ which specifies whether an eventual parental transform (move/rotate/scale) active at the current tick will be applied to the child object. Unfortunately the use of the second option ‘KeepHierarchy’ - I assume dealing with the effect on the children’s children (grandchildren) or further down the hierarchy - is somewhat obscure and absolutely undocumented in the Helpfile. Anyhow; the dislocation of the cabin is what finally disrupts your trailer (on top of unnecessary constraints and missing hinges).

When the “driver” of an IK-chain is a ToPath or LookAlong constraint, it is wise and handy (although not absolutely necessary) to build the chain before installing the Simple constraint. Conversely it is very hard to get the mutual configuration (position/rotation) of the elements of the chain right. Moreover I find it advisable to position the chain close to the beginning of the path and in the accurate direction, in order to have swift results from the IK-solver.

In regard of your new container problem, I think maybe the same issue is at hand. I don’t understand what you mean by

… so I’m afraid I cannot help you without a more precise description of what you are doing exactly. I suggest you try combining container and trailer while the Simple (driving) constraint is disabled.

Luc

PS
I feel you are maybe somewhat confused: Simple constraint versus IK constraint:

  • A Simple constraint is merely an active way of animating (making move and/or rotate) an object. It has nothing to do with IK. In your case it only operates as the ‘engine’, the ‘driving motor’ of the IK chain.
  • An IK constraint mostly defines a goal which the IK element has to reach. That’s why Bongo sometimes has to report “Constraint goal not reached”.

I would recommend a tutorial with accompanying sample models “The basic Why’s of IK” (http://bongo.rhino3d.com/forum/topics/the-basic-why-s-of-ik) concerning the basic structure of an IK-chain.
Also my video tutorial “Simple constraint versus IK: a clarification” http://bongo.rhino3d.com/video/simple-constraint-versus-ik-in-bongo-2-0-a-clarification may be useful.

I’ve done several animation with a container that was first the child of a ship, then the child of a crane and finally the child of the trailer.
As an object can not change parent, I have used 3 containers. In my first animation, all 3 containers were in the same sequence (same timeline) but for next animations, I have used animation sets.
By the way, to load just the objects I need for each animation set, I have used the script SelectionSet from Pascal Golay.

I guess Alan got the sore spot right. You want the container to dangle from the pulley and then be taken along by the truck (or vice versa).
Indeed Alan; a child can only have one parent and that relation is imperative throughout the entire animation i.e. an object cannot change parents. The solution is 2 containers (one dangling and one being towed), the first getting invisible at the time the second appears. After all ; animation is make-believe
Track 002.3dm (108.9 KB)

  • To get a workable distinction I feel it’s handy to give them a different display color (different layers is another possibility).
  • To get a proper preview (Play) I make both (briefly) visible at the start of the animation. Rendering can start at keyframe 1 though.

Luc

PS On the latest illustration I see quite a lot of pivots around the container. I guess it is again an animated group of meshes. You could maybe save the animation data of one mesh (using BongoSaveEntityToFile command), then block the container and reinstall the animation data from the saved xml file to get a clean working environment.