Maria Gallegos (thecure++at++unm.edu)
Mon, 19 Jun 1995 16:20:24 -0600 (MDT)
I started out with trs, which mathematically should be S*R*T.(Correct?).
I know that this is how DCS nodes calculate the matrices, but I need to
calculate it myself since I'm checking for all possibilities.
here is how I initialized the matrices:
/*--- Translate----*/
pfMakeTransMat(transmat, x, y, z);
/*---- Rotate ------*/
/* mat starts out as the identity matrix, and the order of rotation can be
in any order, etc,. xyz, zyx,... */
pfPreRotMat(rotmat,rot[cur_obj->o_rot[0]], rotvec0[0], rotvec0[1], rotvec0[2],mat);
pfPreRotMat(mat,rot[cur_obj->o_rot[1]], rotvec1[0], rotvec1[1], rotvec1[2],rotmat);
pfPreRotMat(rotmat,rot[cur_obj->o_rot[2]], rotvec2[0], rotvec2[1], rotvec2[2],mat);
/*---- Scale -------*/
pfMakeScaleMat(scalemat, xscale , yscale, zscale);
/* scale uniformly in all directions */
pfPreScaleMat(allscalemat, allscale, allscale, allscale,scalemat);
....
/*if order= trs want to T then R then S , so S*R*T */
pfMultMat(mat, allscalemat,rotmat);
pfMultMat(finalmat,mat,transmat);
......
/* else if order = tsr want to T then S then R, so R*S*T */
pfMultMat(mat, rotmat, allscalemat);
pfMultMat(finalmat,mat,transmat);
etc...
I must be doing something wrong since this is not working,
any suggestions?
maria
thecure++at++unm.edu
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:36 PDT