RE: [info-performer] Transformation Matrix

Date view Thread view Subject view Author view

From: Dick Rous (dick++at++sgi.com)
Date: 06/28/2004 06:36:19


Performer has a number of convenience functions for this kind of
calculations.
E.g. from x, y, z, h, p, r (pfCoord) to pfMatrix:
pfMatrix::makeCoord(const pfCoord *c)

See man pfmatrix for details.

Dick.

> -----Original Message-----
> From: owner-info-performer++at++performer.engr.sgi.com
> [mailto:owner-info-performer++at++performer.engr.sgi.com]On Behalf Of Simon
> Perreault
> Sent: Monday, 28 June, 2004 14:36
> To: Deepthi Singh
> Cc: info-performer++at++sgi.com
> Subject: Re: [info-performer] Transformation Matrix
>
>
> Deepthi Singh wrote:
> > Can you please help me with the updating? I want to know how
> > to create the Transformation matrix from xyz and hpr values of the
> > camera ? I think there is something wrong in the way I'm
> using my hpr
> > values.
>
> hpr values are given in degrees and correspond to a rotation
> around axis
> z followed by a rotation around axis x followed by a rotation around
> axis y. The three values are given in that order. To convert to a
> rotation matrix, the following Matlab function can be used:
>
> function R = rotm( h, p, r )
>
> Rx = [ 1 0 0
> 0 cos(p) sin(p)
> 0 -sin(p) cos(p) ];
> Ry = [ cos(r) 0 -sin(r)
> 0 1 0
> sin(r) 0 cos(r) ];
> Rz = [ cos(h) sin(h) 0
> -sin(h) cos(h) 0
> 0 0 1 ];
> R = Ry * Rx * Rz;
>
> Converting this to a C++ funciton should be trivial. See the
> Performer
> manual on page 31 for a helpful figure.
>
> --
> Simon Perreault <nomis80++at++nomis80.org> -- http://nomis80.org
>
> --------------------------------------------------------------
> ---------
> List Archives, Info, FAQ: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
> --------------------------------------------------------------
> ---------
>


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Jun 28 2004 - 06:37:28 PDT