Re: rotates and then translates??

New Message Reply Date view Thread view Subject view Author view

Michael Jones (mtj++at++babar)
Wed, 24 Nov 1993 08:47:50 -0800


On Nov 24, 10:17am, Renee Strong wrote:
> Subject: rotates and then translates??
:
: If we do the following, is performer still going to do the rotates first
: and then the translates?
:
: pushmatrix();
:
: loadmatrix(ident);
:
: translate(obj->trans[0], obj->trans[1], obj->trans[2]);
:
: rot(pitch, 'y');
: rot(yaw, 'z');
: rot(roll, 'x');
:
: getmatrix(mat);
:
: pfDCSMatrix(dcs, mat);
:
: popmatrix();
:
>-- End of excerpt from Renee Strong

This kind of thing is _really_ dangerous. You can only access GL from the
draw process in multiprocess-applications, so this coding style which is
ok on a single-process configuration would cause program termination if
you specify a multiprocess mode of operation such as PFMP_APP_CULLDRAW.

Why not use IRIS Performer host-based matrix routines instead? They will
be as fast or faster, and won't tie you to an only-one-process-for-ever
implementation.

    pfMatrix m, r;

    /* form translation matrix */
    pfMakeTransMat(m, obj->trans[0], obj->trans[1], obj->trans[2]);

    /* pitch about y axis */
    pfEulerMat(r, 0.0f, 0.0f, pitch);
    pfMultMat(m, m, r);
     
    /* yaw about z axis */
    pfEulerMat(r, yaw, 0.0f, 0.0f);
    pfMultMat(m, m, r);
     
    /* roll about x axis */
    pfEulerMat(r, 0.0f, roll, 0.0f);
    pfMultMat(m, m, r);

    /* set DCS' transformation */
    pfDCSMatrix(dcs, m);

-- 

Be seeing you, mtj++at++sgi.com 415.390.1455 M/S 7L-590 Michael Jones Silicon Graphics, Advanced Graphics Division 2011 N. Shoreline Blvd., Mtn. View, CA 94039-7311


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:50:06 PDT

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