transformations ,help

New Message Reply Date view Thread view Subject view Author view

Maria Gallegos (thecure++at++unm.edu)
Mon, 19 Jun 1995 16:20:24 -0600 (MDT)


I am new to Performer and I need to check for all 6 possible transformations,
 trs, tsr, rts, rst, str, srt. I also need to check for all possible orders
of rotations, xyz,zyx,....(which seems to work fine). But the orders of
transformations are not working at all.

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


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:36 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.