Re: [info-performer] Transformation Matrix

Date view Thread view Subject view Author view

From: Simon Perreault (nomis80++at++nomis80.org)
Date: 06/28/2004 05:36:28


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


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Jun 28 2004 - 05:36:32 PDT