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

# How do u find the distance between 2 joints using XPresso

VIEW ALL
 How do u find the distance between 2 joints using XPresso on Jun 7, 2012 at 7:34:51 am

Hi, hopefully someone can help me with this problem. I've been trying to figure out how to determine the distance of one joint along the positive z axis of another joint in XPresso with no luck. For example, how high up the elbow joint rises above a spine joint's position along the spine joint's positive z axis.

I hope I explained my problem ok. I tried messing around with distance node in XPresso but it's giving me strange results because the joints are in a hierarchy.

Anyway, I hope someone can help because I can't seem to figure it out.

 Re: How do u find the distance between 2 joints using XPressoon Jun 7, 2012 at 3:26:42 pm

I would place a null at the tip of one joint and another at the base of the other joint (parent them to the respective joints) and then use a distance node to calculate the distance between them.

Example: 4263_jointdistance.c4d.zip

 Re: How do u find the distance between 2 joints using XPressoon Jun 7, 2012 at 7:32:32 pm

Thanks for the response but this was what I was afraid that I wasn't being clear about.

I'm trying to determine the distance between 2 joints on the first joint's positive z axis only.

If you move the Joint.1.Goal along its x or y axis in the example you provided you will see the result continue to change.

Hmmm. I think I may need a pict to illustrate the problem. I'll post an image as soon as I can because I really need help on this.

I do appreciate your effort to help me though. :-)

 Re: How do u find the distance between 2 joints using XPressoon Jun 7, 2012 at 9:55:06 pm

[Benedict A. Varga] "I'm trying to determine the distance between 2 joints on the first joint's positive z axis only"

So you're looking for the length of the bone in-between the two joints?

 Re: How do u find the distance between 2 joints using XPressoon Jun 8, 2012 at 6:33:30 am

Ok let's see if these images better illustrate what I need help with:

Also in the example above where I show the distance going from 0 to 50.628 is only working because I'm calculating the distance between the neck and elbow joint along the global y position. The second I start rotating any of the spine joints below the neck the distance will obviously change which isn't what I'm looking for.

Anyway, I hope this explains things better and thanks again for trying to help. :-)

 Re: How do u find the distance between 2 joints using XPressoon Jun 9, 2012 at 4:39:32 pm

I think I know how you could do that, but before I go into it, could you explain WHY you're trying to get that information?

 Re: How do u find the distance between 2 joints using XPressoon Jun 9, 2012 at 8:31:18 pm

I'm trying to make a corrective morph for my character's shoulder that's driven by distance instead of rotation. Since a shoulder joint rotates around all 3 axes it seems to be almost impossible to drive a morph by the shoulder joint's rotation.

It may not be a perfect solution but I think it may work. I need to test it out and see the results. Of course I could be completely wrong but I can think of a lot reasons why I'd like to know how to do this that has nothing to do with joints or corrective morphs at all.

Anyway, I think I maybe close to figuring this out. (hopefully...sort of.)

I'm trying to put the equation from this site

http://mathinsight.org/distance_point_plane

into XPresso nodes and I think I'm pretty close.

 Re: How do u find the distance between 2 joints using XPressoon Jun 11, 2012 at 4:33:01 pm

Okayk, here's something that does the trick ... at least in this simplified scene: 4274_measurethingy.c4d.zip

In one sense it's a bit more complicated than it has to be, as instead of tracking the x/z position and getting the distance I could have just measured the distance in Y.

Of course in a full rig you would have to the local position rather than global position to get the 0 height comparison.

 Re: How do u find the distance between 2 joints using XPressoon Jun 12, 2012 at 3:31:20 pm

Wow! You clearly have no idea what you're talking about. Ok, I'm wasting my time here. Let me know when you learn MATH. :-/