MAXON CINEMA 4D: Cinema 4D Forum Adobe After Effects Forum

# Xpresso: scale objects in relation to the distance between 2 Points

VIEW ALL
 Xpresso: scale objects in relation to the distance between 2 Points on Sep 20, 2013 at 2:16:36 pm

Hello forum,

i need help with xpresso:

for an info-graphic i want to show the relationship between three different objects as a pythagorean triangle (see included picture).

The idea is to show the relationship between object A and object B, while C stays the same. That means if Object A gets smaller, object B has to scale bigger in order to keep the 90° angle between the two. (Actually object A and B are more complex than the cubes in the example picture, these are just placeholders for a block with a house/factory etc. on it.)

So my idea was to tie the points that connect the corners between A and B together and then measure the distance between the points on the corners of A/B and A/C and use that ratio to scale both objects. There may be better ways than this and i would be grateful, if someone could point me into the right direction. Since i am new to xpresso, i don't even know which nodes to add. I thought vectors may be a good way to start, but i have no idea how to build something like that in xpresso. Also i want the corner of A/B to stay on that spline in order to keep the 90° angle.

I hope you understand my projekt and i will be very grateful for everybody who is taking the time to school me.

Have a good time, Oskar

6537_pythagoras.jpg.zip

 Re: Xpresso: scale objects in relation to the distance between 2 Pointson Sep 20, 2013 at 6:10:13 pm

This is an ultra-simple setup, but if I understand what you're saying correctly it does what you want it to do: 6540_inversescaling.c4d.zip

 Re: Xpresso: scale objects in relation to the distance between 2 Pointson Sep 20, 2013 at 7:17:15 pm

this uses nulls, one to follow the circle spline and one each for the area so they will stay at the corners of the hypotenuse area and rotate from there. The corner nulls use a target tag to point at the spline null (they were lined up that way to start) XPresso is only used to find the distance from each corner null to the moving null then dividing that by the original area object width to feed to scale of the null.

6542_pythagorus.c4d.zip

 Re: Xpresso: scale objects in relation to the distance between 2 Pointson Sep 20, 2013 at 7:48:09 pm

You win. ;-)

 Re: Xpresso: scale objects in relation to the distance between 2 Pointson Sep 20, 2013 at 7:50:29 pm

maybe this time, but that's a reverse to the normal :-)

 Re: Xpresso: scale objects in relation to the distance between 2 Pointson Sep 21, 2013 at 12:29:47 am

thanks for the quick replies. I downloaded both and will look into them tomorrow (it is 2 in the morning).
All the best,
Oskar