Re: pfHighlight

New Message Reply Date view Thread view Subject view Author view

Bernard Leclerc (bleclerc++at++cae.ca)
Mon, 2 Dec 1996 11:14:23 -0500


Cris Villarma wrote:

> I'm wanting to use pfHighlight to dynamically color
> an aircraft *.flt model. My code compiles but bombs out
> during run-time when it reaches I call pfGSetHlight.
>
> Here's some of my code:
> -----------------------
>
> pfGeoSet *models[50];
> pfHighlight *hlight[50];
>
> void
> init (void)
> {
> int index;
>
> for (index=1; index<50; index++)
> {
> hlight[index] = pfNewHlight(NULL);
> if (hlight[index])
> {
> pfHlightMode (hlight[index], PFHL_FILL);
> pfHlightColor(hlight[index], PFHL_BGCOLOR, 1.0f, 1.0f, 1.0f);
> pfHlightAlpha(hlight[index], 0.5);
> }
> }
>
> for (index=1; index<50; index++)
> {
> models[index] = (pfGeoSet *) pfdLoadFile("model.flt");
> if (models[index])
> pfGSetHlight(models[index],hlight[index]);
> }
> }

Cris,

You can't cast a pfNode (returned by pfdLoadFile) to a pfGeoSet. This is
why pfGSetHlight() crashes when accessing the pointer.

You might want ot look at pfuTravNodeHlight() to highlight a specific node
such as the one returned by pfdLoadFile().

--
Bernard Leclerc			CAE Electronics Ltd., 8585 Cote De Liesse
Technical Leader		Saint-Laurent, Quebec, Canada, H4L-4X4
3-D Graphics Applications	tel: +1 514 341 2000 extension 2275
bleclerc++at++cae.ca			fax: +1 514 340 5496
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/
            Submissions:  info-performer++at++sgi.com
        Admin. requests:  info-performer-request++at++sgi.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:04 PDT

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