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; “`