Archived post by petz

hey jake, my little rant wasn’t directed to you. sorry if it came off that way! it was just me having a moment of bad temper.

anyways, i’m just putting together a quick fix of your file. i’ll upload it in a minute …

here’s the file.

it’s sparsely/not commented but should do the trick. on the right there is div-free field coming from DOPS to compare against the result …

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20195404/24/19/poisson1.hiplc

Archived post by lcrs

to find the “difference” between your two matrices you can invert the first then multiply by the second – think of it like “remove the transform of matrix1 from matrix2, leaving just the difference between them”. that gives you a matrix, which you can turn into a quaternion, which you can turn into an angle/axis rotation like @w “`matrix3 m1 = ident(); matrix3 m2 = ident(); rotate(m2, 0.5, {1, 0, 0});
matrix3 diff = invert(m1) * m2; vector4 quat = quaternion(diff); v@w = qconvert(quat);“`

Archived post by Juraj

@TOADSTORM hi, I played today with roll correction, you were right, I used up vector to be (0,1,0), but after I got front (original), side (front x up) and then re-computed up, so that it is not always pointing upwards

it was easier, than I thought, but I needed to look at it with fresh eyes

“` string cam_path = chs(“cam_path”); matrix cam_m = optransform(cam_path); matrix3 cam_rot = qconvert( quaternion( (matrix3)cam_m ) ); matrix cam_trans = transpose(cam_rot) * cam_m;
matrix xform = ident();
vector back = normalize( {0,0,1} * cam_rot ); vector side = normalize( cross( {0,1,0}, back ) ); vector up = cross(back, side);
matrix3 fixed_rot = set(side, up, back);
xform *= fixed_rot; xform *= cam_trans;
v@P *= xform; “`