Pre/Post Draw Callbacks, dissapointment! (fwd)

New Message Reply Date view Thread view Subject view Author view

Torres Mario 678-3280 AMSRL-BE-M (mtorres++at++arl.mil)
Tue, 29 Aug 95 11:01:02 MDT


  Sorry about the typo below!

> On the recommendation of a few good programmers from this list, I tried
> to illuminate a helicopter by dimming the pfLightColor of the sun on the
> perfly program through the use of PreDraw and PostDraw functions. I am
> very dissapointed because through this functions I can't even turn off
> the light for the helicopter in the PreDraw and then back ON in the
> PostDraw. I've set it up in the following manner if anyone cares to comment:
>
> pfNodeTravFuncs(Apache->dcs , PFTRAV_CULL,
> apachePreCull, apachePostCull);
>
  should be:

   pfNodeTravFuncs(Apache->dcs, PFTRAV_DRAW, apachePreDraw, apachePostDraw);

> long apachePreDraw(pfTraverser *trav, void *data)
> {
> oldtod=ViewState->tod;
> ViewState->tod=0.00f;
> pfLightAmbient(ViewState->sun, 0.0f, 0.0f, 0.0f);
> pfLightColor(ViewState->sun, ViewState->tod, ViewState->tod,
> ViewState->tod);
> }
>
> long apachePostDraw(pfTraverser *trav, void *data)
> {
>
> ViewState->tod=oldtod;
> pfLightAmbient(ViewState->sun, 0.2f*ViewState->tod,
> 0.2f*ViewState->tod,
> 0.2f*ViewState->tod);
> pfLightColor(ViewState->sun, ViewState->tod, ViewState->tod,
> ViewState->tod);
> }
>
>
> The apache model is a multigen model, and I would expect that the model
> would be dark as if with no light and then the rest of the terrain would
> appear with the light.
>
> Also, is updating the apache DCS in the preDraw function a good or bad
> practice?
>
> All +comments welcomed,
>
> Mario T.
>
>
>
>


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:51:50 PDT

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