Math help


RE: Math help
#5
(2019-03-24, 21:20)Roland Melkert Wrote: In that case P2 is your base local (y) vector.
Normalize p2

Cross p2 with world Y   (0, 1, 0)
to Get a second local vector perpendicular to p2 (your local z)
Normalize  local z

Then cross p2 and the new local z to get the 3rd vector (your local x)
Normalize local x

Use the 3 local axis to construct the matrix.

There are limits though, depending on the direction of p2 things will flip 180 degrees at some point and if p2 is close to world y it will not solve.
In my path generator I choose world Y or Z as the reference bases on the biggest angle.

There might be a more elegant way of solving this but I'm no math major Smile

Thanks. This seems similar to what I was reading but for some reason wasn’t leaking into my brain.
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Math help - by Orion Pobursky - 2019-03-24, 19:06
RE: Math help - by Roland Melkert - 2019-03-24, 19:31
RE: Math help - by Orion Pobursky - 2019-03-24, 20:00
RE: Math help - by Roland Melkert - 2019-03-24, 21:20
RE: Math help - by Orion Pobursky - 2019-03-24, 21:25

Forum Jump:


Users browsing this thread: 1 Guest(s)