Dan Mapes (dmapes++at++roninworks.com)
Thu, 14 Oct 1999 08:19:55 +0200
In performer with an identity view matrix, Z is up, the view is along
negative Y and the X axis is "to the left".
// Assuming orthogonal and normalized view, up and right direction vectors.
pfVec3 leftDir( rightDir );
leftDir.negate();
pfVec3 invViewDir( viewDir );
invViewDir.negate();
pfMatrix mat;
mat.makeIdent();
mat.setRow( 0, rightDir );
mat.setRow( 1, invViewDir );
mat.setRow( 2, upDir );
channel.setViewMat( mat );
pfSCS scs( mat );
dcs.setMat( mat );
If the mapping given above for some reason does not work correctly in your
app, the basic approach is still valid and can be easily fixed by modifying
the direction and/or order of the vectors.
>given three vectors representing the view direction, the up vector,
>and the right vector, how does one convert to hpr?
>specifically, i know how an object is oriented in a given coordinate
>system by the aforementioned orthogonal vectors. but i need to
>convert to hpr so performer can properly orient the object.
>-----------------------------------------------------------------------
>List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>
This archive was generated by hypermail 2.0b2 on Wed Oct 13 1999 - 23:21:28 PDT