[Closed] Finding point on spline close to mat or quat
This is more of a math problem than a Maxscript problem, but I was hoping someone would help an old man out with a algorythm here.
I have a line I’ve drawn (let’s assume it’s a straight line for the easy purposes of discussion here) and what I need to find is a quat or Matrix3 value ON that line nearest to some other quat or Matrix3 value. IOW, let’s assume we have a box that moves parallel to that line but at some offset. I want to return a position value on that line equivilent to a perpendicular line drawn through the box.
Of course it may not be parallel to the line, but the principle should be the same. Picture’s worth a thousand words, so I’ve attached one. Any ideas, code, jokes or winning lotto ticket numbers would be greatly appreciated.
Actually, maybe I had better elaborate in case someone has a better idea in a completely different direction.
I’m trying to write a routine that takes biped footsteps in a straight line and conform them to another spline. My theory is that if I can draw a straight line from the beginning com position to the end com position and then measure where on that line the footsteps fall (based on the previous post idea) that I could then apply this to a length parameter on the new spline path.
So I really need to know how far along the straight path any given footstep is, and then apply this distance to the new spline and move the footstep there. I know how to manipulate footsteps and otherwise handle the biped, but the basic math of getting positional information from objects near one spline and translating it to another spline is beyond me (at least so far).
So if anyone has even a completely different direction to go in I’d love to hear about it.
Ah… nevermind.
(I really hate it when I find the answers a few minutes after posting a plea. I feel like an idiot for bothering folks so when I really need help I won’t get it. The old “cry wolf” syndrome).
Anyway, I found all the path functions that do exactly what I want and make this a piece of cake. Sorry not to have RTFM.