From: Don Burns (don_burns++at++peru.engr.sgi.com)
Date: 04/28/2000 11:17:39
In-Reply-To: ken sartor <sartor++at++visidyne.com>
"billboards in draw callbacks" (Apr 28, 11:23am)
X-Mailer: Z-Mail (3.2.3 08feb96 MediaMail)
On Apr 28, 11:23am, ken sartor wrote:
> Subject: billboards in draw callbacks
>
> pfHi -
>
> I have put a pfBillboard in my code in a draw callback.
> Problem is that it does not rotate...
>
> What am in missing to make this work?
>
> pfTIA.
>
> ken
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>-- End of excerpt from ken sartor
Ken,
Something fundamental is missing here. pfBillboards are a type of pfNode and
therefore belong on the scene graph. If on the scene graph, the node will be
visited during the App traversal and any computations needed to rotate the
billboard will be done here, according to the parameters you set up for it.
I just searched for an example for you, but found that the only billboard
example we have in /usr/share/Performer just creates a billboard. My
suggestion is to use simple.C and billboard.C in the
/usr/share/Performer/src/pguide/libpf/C++ directory. Modify simple.C at
about lines 99 - 108 from:
pfNode *root = pfdLoadFile(argv[1]);
if (root == NULL)
{
pfExit();
exit(-1);
}
// Attach loaded file to a new pfScene
pfScene *scene = new pfScene;
scene->addChild(root);
to:
pfGroup *grp = new pfGroup;
pfNode *root = pfdLoadFile( argv[1] );
if (root == NULL)
{
pfExit();
exit(-1);
}
pfVec3 rightHere(0, 0, 0);
pfBillboard *bb = MakeABill( rightHere, myGeoset, PF_Z );
// Attach loaded file to a new pfScene
pfScene *scene = new pfScene;
grp->addChild( root );
grp->addChild( bb );
scene->addChild(grp);
You will, of course have to supply myGeoset.
-don
This archive was generated by hypermail 2b29 : Fri Apr 28 2000 - 11:18:30 PDT