Well, I'm looking for the same solution. I've drawn it up to help visualize it.
Is there a constraint that would allow the trailer wheels to follow the truck, not along the path of the truck, but rolling in the direction the trailer is headed. Is there a lateral constraint that will allow the wheels to follow at a fixed distance behind the trailer, while the length of the trailer to stay constant. In a curve, this will cause off-tracking, so that the rear wheels of the trailer are not following the path in a curve, but trailing behind at a constant distance in the direction the tires are rolling, just like a real trailer.
Any help would be greatly appreciated!
Thanks, and happy holidays to all.
Solved! Go to Solution.
Solved by leeminardi. Go to Solution.
Would the following sufficiently capture the trajectory for the trailer?
The red spline is the path of the truck. The green arc has a radius equal to the distance from the hitch to the midpoint between the two trailer wheels (your distance L). The truck's initial position is TRUCK-1 and the trailer's TRAILER-1. Positions 2 and 3 are subsequent positions some time later. The change in time (number of frames) could be adjusted as necessary. The new position of the trailer is determined by finding the point of intersection of a line defined by the current position of the truck to its previous position (the yellow line) and the green arc for the truck's current position. As a result, the trailer's path is not the same as the truck's path which is how it is in reality.
I'm not sure I can write an transform script to capture the trailer's motion but I wanted to verify my understanding of the path before I try. What do you think?
On further thought the new position of the trailer should be based on the previous position of the trailer (not the truck).
For example, position and alignment for TRALER-3 should be as follows.
Trailers should follow the track path, not killing other traffic participants.
In "normal" driving on normal roads.
Front and rear wheals on same vehicle don't always going exactly same path, but path constraint (with follow) is good enough for (not scientific) animations.
That’s the basic idea. Here is different diagram that might illustrate the geometry/trig in a different way
Thanks for working on this. I appreciate you and the others on the forum. I'd be at half capacity at all times without the help.
I thought about doing it this way, too (arc-to-spline) with some artistic license. For most cases this would be just fine, and I probably will try it to compare the "realness" factor.
Meanwhile, I stumbled on the solution on YouTube. Kudos to Realistic Animation for figuring it out and sharing it. I didn't expect it to be this hard to prevent wheels from rolling sideways, or it's so obvious as to be trivial, and I'm the only one who does not know how to do it. 😪
I've watched the video and I STILL can't figure it out, mostly because I'm slow, and there's no narration/explanation. Also, it's an older version of 3DS Max.
I'd appreciate any help understanding how this works.
@truckexpert that's a very sophisticated solution! I'm not sure I follow all of it.
I played around with the geometry reference you had in post #5. I created a transform script for a point that locates the position of the trailer's rear wheels then used a LookAt constraint to orient the trailer. There are two key points to be determined,
1. The instantaneous center of curvature for the path at the location of the truck (pCen). To approximate this point I found the intersection of the vector in the direction of the rear wheels of the truck (truckAT.row2) and the Y vector of a dummy that follows slightly behind the truck (dummyA). To help in the debugging of the transform script, the point "pointCen" (blue) tracks the center of curvature as you scrub the time line and the truck (and dummyA) follow the path. It's important that the center of curvature point stays outside the red circle that has a radius equal to the length of the trailer. As pointCen gets closer to the truck the turns get tighter and more challenging for the trailer.
2. Another point to calculate is the location of the rear wheels of the trailer. This point is a distance L (40' in my example) from the truck's trailer pivot and at a point that is tangent to a line from pCen to the circle defined by the trailer length. Which of the two tangent points to use is determined by whether the truck is turning clockwise or counter-clockwise. The sign of the z component of the cross product of the direction vector of the truck with the vector going from the truck to pCen is used to determine the turn direction.
The results are a bit rough but look better when the path radii are much greater than the length of the trailer.
Well, interesting approach. I didn't know MAX would do dot and cross products. Thanks for the help!
Can't find what you're looking for? Ask the community or share your knowledge.