Hi Matt,
I will go in the next few paragraphs through several points to share how my thought process is. It might sounds different, but just read along and let it sit for a while. As an engineer, I can explain the math, but as an artist, I can only show my way of doing and encourage to find out what works for you in the best way. It is never the tech that makes us unique, it is the way we are able to look at the world and really see (or not, but assuming we know it already)
The main part in most of the math above is based on a 90º relation somewhere. “Pythagoras” works that way for example. So the formula in your image might be out of luck, or do I miss something?
The formula in the first link [intmath.com] is an example of the relations, but the problem with 3D animation is, that we need to look often from another angle. What is an x axis might be a z axis after a 90º H rotation (i.e., breaks the solution), which would be the first thing to look at. Just to name a small problem … Local values often don’t change in relation to the parents.
However, the biggest step to get things going (in 3D animation) is to let go of the idea how things really work, as in “Work In Reality”. The initial question must be, what do I really see, want to see as final animation, instead of looking based only on your knowledge. If we look with what we know, we don’t see anymore (as in any MORE).
We create magic, not engineering here. Over the years I have seen it too often that people get stuck in the idea to reproduce reality. Cinema 4D is an animation tool, targeting a visual result that has to convince people what they are seeing is “real”. The audience is looking from the point of “knowing” and so we get away with a lot of our “magic”. Relying purely on knowledge makes blind for most creative solutions.
Let me deepen that thought. The biggest stop in our development is the sentence “I know that”. The biggest push in creativity are the two words “What if …” followed by something that others would express as: don’t bother.
Last but not least, “these are the rules and we have done it that way since ever” are the most limiting way to work in an creative environment. The only thing that counts is that we make our audience imagine.
As I always extent the old saying for film, “don’t tell, show!”, with: make the audience imagine – Instead of show, instead of tell. Here is the starting point for animation.
So, back to math, first we make notes of everything we have already. Then we outline what we need, and with that I mean what is really visible as final result. In my set up, the crankshaft doesn’t move the conrod at all, they have no mechanical or dynamically relation ship. You might say, but they are connected via math. Well, I could create a slider [user data] and have the crankshaft rotating from it, as well the piston go up an down, while the conrod is derived from the slider in position and rotation. All three part could be placed on different spot on the depth axis, but a camera could combine them all as one working unit. After all, we decide and find the flow of information, and C4D is based on an information-flow as well, but it is wide open to any tricks we come up with.
All of that should lead after a while to see beyond what one knows and what reality would dictates. Then things fall into new sub-units and from there each part might receive new solutions how to move it. The smaller the unit is, the less complex each part will be. Which eery part that is solved, we gain more information to solve the next step.
After all, there is something any good inventor knows, there are no failures, there is only gained experience. (For more, see the NLP handbook, how the brain works
For the the solution of the example that I have shared here, I ignored the mechanic dependency at the connection point of conrod and crankshaft. I just focused on the piston, as it seemed the simplest to solve. Which made me feel better and more open to stay creative to fond “something” new for the conrod. Since I had the piston movement, I thought, “What If …”
Well, what if I make the conrod a child of the piston, and just find a way to point to the part that the crankshaft has for it. A target Tag came to mind, but I wasn’t really happy about it. I find the XPresso method more elegant and I can control the priority in the cleanest possible way. Tags, as in constrains, mixed with other dependencies, not so much. Since I had the XPresso window open, I knew that the P.Y of the piston was already correct, so the math need to be found in the part I had so far established.
SQRT(($3*$3)-($2*$2))+$1
The Input Value 1 shows up as $1, the Value 2 as $2, the Value 3 as $3
SQRT() stands for a square-root of the content in the ()
The $3 is the conrod from axis to axis
The $2 is the horizontal [X] value
So, the square root out of ($3*$3) [square] subtracted by the square of the horizontal ($2*$2) equals the Y value above the specific crankshaft. The Y value below the crankshafts connection point and the axis of the crankshaft was already established, so the plus of the $1 made the full Y length between piston axis and crankshaft axis. ($3*$3) could have been also written as SQR($3).
Please check out the Formula in the Help Content Appendix.
I hope that helps a little bit
Happy Holidays