`// formula to change from one space to another // P = inverse(m1) * m2
// get the position and orient data vector start_p = point(0, “P”, 1); vector end_p = point(0, “P”, 2); vector4 start_orient = point(0, “orient”, 1); vector4 end_orient = point(0, “orient”, 2);
// calculate the blended values float blend = fit(@Frame, 1, 48, 0, 1); end_p = lerp(start_p, end_p, blend); end_orient = slerp(start_orient, end_orient, blend);
// matrix at start matrix3 start_m = qconvert(start_orient); vector start_n = set(start_m.zx, start_m.zy, start_m.zz); vector start_up = set(start_m.yx, start_m.yy, start_m.yz); matrix a = maketransform(start_n, start_up, start_p);
// matrix at end matrix3 end_m = qconvert(end_orient); vector end_n = set(end_m.zx, end_m.zy, end_m.zz); vector end_up = set(end_m.yx, end_m.yy, end_m.yz); matrix b = maketransform(end_n, end_up, end_p);
matrix final = invert(a) * b; pos = pos * final;`
There we go! Thanks so much! @TOADSTORM + @jake rice 😮 . Infinite fishies for me!
Need to handle scale, but I already have code for that.