|
|
Tips'n'Tricks
The Tips in detail |
|
|
|
|
|
"Tracking the middle of two paths simultanously." |
|
|
|
|
|
You made objects each following it's own path through space and time. You want to track the middle of them, ie. because you want to make a camera look there or due to other needs you want to estimate this position. Estimating the "middle position" (or center-world-coordinates) of two static objects is easy: Group them, align the third object to the group's center. Doing this over the time you either got to estimate the refering coordinate for each frame, setting up a positional list, or you'll use an expression controller. Using expressions can be annoying, since a basic knowledge and understanding of mathmatics is required to get them right. In this case you will want to have a look at vectors (geometry, n-dimensional space) and their mathmatical logic. What you want is to determine the half of the length of the vector created between the center of object 1 and the center of object 2 and apply changes of either coordinate (object 1 and / or object 2) to the coordinates of the third one or: 0.5 * P->Q. For the three-dimensional room, using kartesic coordinates, the formular would be:
___ PQ = 0.5 * SQR( ( x1 - x2 )2 + ( y1 - y2 )2 + ( z1 - z2 )2 ) I managed to get this right by one single and simple expression. To demonstrate this procedure, I'll set up a simple scenario including three dummies and two splines:
By using the factor 0.5 you tell that you want the middle (or center) of the vector dummy01->dummy02. Modifying this will enable you to tell various fractions (or multiples) of this vector and translating it to dummy03. The smaller the factor, the closer dummy03 will stay to dummy01, the bigger the factor (up to 1.0) the closer dummy03 will stay to dummy02. Using negative factors (below 0 (zero)) or above 1 (one) is possible, too, but might lead to unpredictable results (I have not checked this out to lengthes. Any volunteers?) This expression works well while dummy01 and dummy02 are using Bezier positions. I did not test this expression on other positional controllers (ie. Euler or List) and not using Bezier positions might not work with this expression. If you happen to get strange results, try assigning a controller Position XYZ to dummy01 and dummy02. Sometimes the Bezier-Coordinates are not translated correctly into the expression.
|
|
|
|
|
|
|