6
$\begingroup$

You know how a train wagon moves on its tracks? If it takes a curve only the wheels stay perfectly above the track, the rest of the wagon might get offset a bit.

This motion is exactly what I am trying to recreate in Blender.

Try one: Armature constraint and offset

First thing I tried was using an armature with two bones, one following my path with a constraint, the second just with an offset. On pretty straight paths this is very effective.

Pic 1: The green bone is the middle one, the blue one is the offset one, the orange line is my path and the circle represents the fixed distance for the second bone. The blue bone should always be on the crossing of the circle and the path. Pic 1

However, this turned out to be ineffective for sharp turns, because the offset is not the direct distance (represented by the circle and purple line) but the distance via the curve (as seen in Pic 2, green). Pic 2

Try two: Armature constraints and limit distance

Second way I tried is similar to the first, it uses an armature and two bones with a follow path constraint, the second having an offset. The only thing that's different is that I included a Limit Distance-constraint on the offset bone. This worked pretty well, as seen in Pic 3, except that it limits the distance after it follows the path, which means it isn't on the path anymore. The otherway around is even less effective (Limit Distance, then Follow Path) because then the position gotten from limiting the distance is used in following the path as well. Pic 3

Third try: Line segment and curve modifier

The last option I tried, came from this post. It used a line segment and a curve modifier on it. This seemed very effective too, except I had the same problem as in my first try; it didn't use the direct distance (purple) but the curve distance (green) to bend the segment (Pic 4). Pic 4

My final question

How can I make two points follow the same curve but with always a certain distance apart as the crow flies?

$\endgroup$

1 Answer 1

4
$\begingroup$

You can do it with animation nodes.

I use a loop to iterate over the points of the curve and calculate the distance between the two points.

Node tree:

enter image description here

result:

enter image description here

Note: the higher you increase the amount of the float range, the more precise the result will be. This is NOT an exact result, it is "just" an approximation. But the approximation will be really good if the amount is high enough.

Another possibility

... might be to give physics a try...But i am not sure whether it is what you want.

I gave the curve a rigid body after converting it to a mesh. Then a added an empty with rigid body constraint type "point":

enter image description here

result:

enter image description here

Note: i had to increase the substeps to 100 so that it worked realistic...

enter image description here

$\endgroup$
8
  • $\begingroup$ Thanks for this answer. I have two questions: - Is this possible maybe with Geometry nodes? - What are the different objects in your node tree you used? $\endgroup$
    – lajawi
    Oct 3, 2021 at 17:34
  • 1
    $\begingroup$ at the current development of geometry nodes AFAIK it is not possible. I use a loop here and loops are not possible with geometry nodes right now. $\endgroup$
    – Chris
    Oct 3, 2021 at 17:39
  • 1
    $\begingroup$ what do you mean with objects? i used a cylinder, a cube and a circle (which is the bezierpath)...if you mean that....the spline/curve is generated/created by the AN node tree $\endgroup$
    – Chris
    Oct 3, 2021 at 17:41
  • 1
    $\begingroup$ a target in AN is an object which will be generated by AN. In this case it is a curve/spline and is the "cylinder"/distance between the two objects. I wanted to visualize the distance so that you can see it is constant and that it looks a bit better ;) $\endgroup$
    – Chris
    Oct 3, 2021 at 17:56
  • 1
    $\begingroup$ i know - if you are new to animation nodes, this is hard to understand. But i am sure, if you learn it you will love it. Possibilities are amazing and it is really worth learning it. $\endgroup$
    – Chris
    Oct 3, 2021 at 17:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .