Re: [info-performer] Want to put a pfb model on the top of another pfb Model

Date view Thread view Subject view Author view

From: Christian Beaudoin (Christian.Beaudoin++at++irdpq.qc.ca)
Date: 08/26/2004 07:15:58


Hello,

In your example, the pos vector is not used !

To positionate an object in the scene graph you must use a coordinate
system. In Performer, you don't move the object, you move their
coordinate system. There are 2 kinds of coordinate system interesting
in your case:

1) pfSCS : Static Coordinae System -. use it to positionate objects hat
won't move -> faster.
2) pfDCS: Dynamic Coordinate System - use it for objects you want to move.

In your case, you should use pfSCS.

To create a pfSCS you must first create a matrix and assign it to the
pfSCS in it's constructor.

           pfSCS *scs[16]; // Array to keep track of each scs.
           pfMatrix mat;

    pfNode *root = pfdLoadFile("terrain.pfb");
    pfScene *scene = new pfScene;

       scene->addChild(root); //root is the terrain model

> pfNode *plane = pfdLoadFile("watertower.pfb");
>

>
> for(i=0;i<15;i++){
>

                 mat.makeTrans( 15*i, 15*i, 0.0);
                 scs[i] = new pfSCS( mat );
                 scs[i]->addChild( plane );
                root->addChild( scs[i] );

    }

For better understanding you should read about the use of matrix in
computergraphics and about coordinate systems in Performer.

I don't garanty this code will compile but it should be something like that.

    Christian Beaudoin

Mr. Rajesh R wrote:

>
>
>
>
>Any suggestions
>
>Rajesh.R
>
>
>-----------------------------------------------------------------------
> 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 : Thu Aug 26 2004 - 07:16:27 PDT