Activity › Forums › Maxon Cinema 4D › How do u find the distance between 2 joints using XPresso
-
How do u find the distance between 2 joints using XPresso
Posted by Benedict A. varga on June 7, 2012 at 7:34 amHi, 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.
Adam Trachtenberg replied 14 years, 3 months ago 3 Members · 9 Replies -
9 Replies
-
Adam Trachtenberg
June 7, 2012 at 3:26 pmI 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
-
Benedict A. varga
June 7, 2012 at 7:32 pmThanks 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. 🙂
-
Brian Jones
June 7, 2012 at 9:55 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?
-
Benedict A. varga
June 8, 2012 at 6:33 amOk 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. 🙂
-
Adam Trachtenberg
June 9, 2012 at 4:39 pmI 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?
-
Benedict A. varga
June 9, 2012 at 8:31 pmI’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
https://mathinsight.org/distance_point_plane
into XPresso nodes and I think I’m pretty close.
-
Adam Trachtenberg
June 11, 2012 at 4:33 pmOkayk, 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.
-
Benedict A. varga
June 12, 2012 at 3:31 pmWow! You clearly have no idea what you’re talking about. Ok, I’m wasting my time here. Let me know when you learn MATH. :-/
-
Adam Trachtenberg
June 12, 2012 at 5:03 pmWow, you are seriously RUDE and IMMATURE. I’ve spent a significant amount time trying to help you with your problem, just to be nice, but it seems that you’re incapable of articulating what you’re trying to achieve, so it’s proven to be quite impossible. I would suggest that — since you can’t help yourself — you should at least put more effort into explaining your problem. That way, in the unlikely event that a competent person might be willing to help you going forward, they at least have some clue what you’re struggling with.
Reply to this Discussion! Login or Sign Up


