Centering an Object BEtween Two Others

Centering an Object BEtween Two Others

Hi...

Is there a way to have an object always centered between two other objects even if one of those other objects are moved?

So (basic example): You have two cubes and a sphere between them. If you move either cube, the sphere stays centered between them.

Would also be nice if you can turn off/on axis so it will only work if they are moved in a particular direction, but not others.

Thanks!
Bob
 

I think a script would be necessary, but...

1-Using your example, merge the two boxes into one object and
then choose Coord-System/Center Pivot Point/Burn Pivot Point.

2-Add a Parent Constraint to the sphere, uncheck Maintain,
then make the boxes object the Target and the sphere
will jump to the center point between the two boxes.

3-When you want to move one of the boxes, go to Polygon Mode,
click on any polygon and hit cmd-g to select all connected polygons.

4-Once you move a box, then choose Coord-
System/Center Pivot Point/Burn Pivot Point again.

You can also uncheck any Constrain Axis you want.

 
Yeah, I drove myself nuts parenting and reparenting and reparenting trying to get it to work, but that method just doesn't work.

I wish C3D had more constraints and more options within the constraints.

Bob
 
Dunno if this helps, but I made an attempt with the particle array.
Choosing three different particles, you can animate the array size and the three objects will always be evenly distanced. Adding two empty folders and setting seed to 11, I could make an array with a cube in the middle, followed by a ball and a cone to the right and nothing to the left, so that the particle array's origin is also the cube's origin.
The problem now is how to move the outer object, the cone.
This has to be done by rotating the whole particle system which of course will rotate all objects.
But if f.i. the center cube should not rotate, it can be arrested via a target tag pointing to two more dummy folders.
See example file animation.
 

Attachments

  • Target array.jas.zip
    11.4 KB · Views: 218
Maybe two position constraints weighted 50% between each of the two objects? Although in this example I did better with 75% on the Ball and less on the Cube.

Edit: that's weird. If you grab and move the ball, it works as expected. If you move the Cylinder, the Cone jumps to that position. Odd. Will require further investigation.
 

Attachments

  • constraint.zip
    7.4 KB · Views: 219
Last edited:
Thanks, but the particle versions aren't exactly what I need.

I'll check Kurt's example, but it sounds like you're running into the problems I was.

Bob
 
Maybe two position constraints weighted 50% between each of the two objects?

A simple and effective solution.
With the one weight at 0,5 and the other at 0.33 the cone is in the middle.
When I animate both guide objects in three dimensions the cone stays in the middle with no jumping.
And disabling axes in the tags works too.
 
* Set up a particle mesh on a simplex spline with just 2 points.
* The particles are 2 cubes (on either end) and one sphere (in the middle)
* Pont record the terminal points. These are just place holders for the location of the two cubes.

* Result:
* The cubes move as a function of the terminal points relocation.
* The sphere stays in the middle.

* Note:
* The editor, when fiddling with the spline shows SFA :frown:
* But the animation works.

PS:
* BTW: You can animate all prams of the components.

PS #2
* Post Scriptum 2:
* I just tested the locations with the ruler and the midpoint for the sphere is maintained quite precisely.
 

Attachments

  • Proof of the Heliocentric Universe.jas.zip
    11.2 KB · Views: 203
  • PotHCU.png
    PotHCU.png
    48.1 KB · Views: 258
  • Test 2.jas.zip
    12 KB · Views: 202
Last edited:
Not quite what I'm looking for. Not sure why the simple method of have the strength on each constraint doesn't work. I've changed priorities, but that doesn't work.

Perhaps two slots in the Parent Constraint with a 50% mix. You can have a slider that can you can change to any percent in case you need one object off center, as well.

Another constraint idea: a Clamp or Drop Constraint. Not sure what to call it, but it restricts object from going past a certain point. So, when animating a character, their feet wouldn't go through a floor object. This way you always know you feet are planted.

Bob
 
Last edited:
Back
Top