Re: [info-performer] Getting translation and rotation values froma 4x4 matrix

New Message Reply Date view Thread view Subject view Author view

From: Dan Johnston (dan.johnston++at++nrc.ca)
Date: 03/31/2003 04:57:02


Paolo Farinelli wrote:

> Hi,
>
> Try using: void pfMatrix::getOrthoCoord( pfCoord*coord );
>
> Note that if your DCS lies under other DCSs, you may have
> to walk up the DCS's ancestors and compute the combined
> transformation matrix (assuming this is what you want).

This is a lot of work! Since Performer is already 'walking' the
matrix transforms as part of every frame, why not just grab
the results you need.

Look at pfTraverser. Set a callback to be triggered when your
node is being traversed, grab the position and orientation
fully computed (using the getOrthoCoord as described) and
then store the results into shared memory.

Your application can set the viewpoint from this up-to-date
value of node position. Very little code on your part, and no
duplication of computations.

This works for me ... and many others!

Dan.Johnston++at++nrc.gc.ca

>
>
> Hope this helps,
> Paolo
>
> Dr.Ganagi wrote:
>
> >Hi,
> >
> >We are animating viewpoints in our application. These viwpoints are
> >generated from scene DCS nodes. We are not able to get translation and
> >rotation (hpr) from the DCS matrix.
> >
> >If anyone has got a way to get translation and rotation values from a 4x4
> >matrix, please suggest us.
> >
> >Thanks in advance,
> >Ganagi
> >
> >-----------------------------------------------------------------------
> > 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
> >-----------------------------------------------------------------------
> >
> >
>
> --
> Paolo Farinelli paolo++at++sgi.com
> Member of Technical Staff, OpenGL Performer 1-650-933-1808
> Silicon Graphics 1600 Amphitheatre Pkwy, Mountain View, CA 94043
>
> -----------------------------------------------------------------------
> 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
> -----------------------------------------------------------------------
>
> ------------------------------------------------------------------------
>
> Part 1.2 Type: application/ms-tnef
> Encoding: base64

--
      ___|__    |
      /  |  \   ||\      Daniel (Dan) Johnston
     /___|___\  || \     Dan.Johnston++at++nrc.gc.ca
    _____|____  ||  \    National Research Council of Canada, London, ON
    |    |    | ||   \   Integrated Manufacturing Technologies Institute
\___|    |    | ||____\  Tel: (519) 430-7081   Fax: (519) 430-7090
 \_o_\___|____|_|______\_    Inst: http://www.nrc.gc.ca/imti
  \                o /    These opinions are my own! Not those of NRC.
   \________________/    Virtual Reality:
                        http://www.nrc.gc.ca/imti/vetc/home.html
 More Tall Ships - Fewer Computers!


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Mar 31 2003 - 04:58:16 PST

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