Re: pfLightOn in node draw-Callbacks
John Rohlf (jrohlf++at++tubes)
Fri, 4 Nov 94 11:05:40 PST
> > > Unfortunately, this solution is working just like a headlight,
> > > because the lightsource is moving depending on the viewer-position.
> > > If I move the pfPopMatrix to the PostNodeCallBack-function, the
> > > node is not rendered, which is understandable. Is there any chance to
> > > solve the problem with the method above ? I suppose pfLightOn is
> > > not of any use in nodeDrawCallbacks at all. If so, is there an other
> > > way to illuminate certain objects only, except modifying the
> > > pfGStateAttr ?
> >
> > John wrote:
> >
> > This callback method will work if you have the appropriate
> > ModelView matrix set up. If you don't want headlight mode, then
> > don't load an identity matrix - leave the ModelView matrix alone.
> >
> >
> > Another option is to set the PFSTATE_LIGHTS attribute of
> > your pfGeoStates. Just call pfGStateAttr and pass it an array of
> > pfLights that you wish to use.
> >
> >
> Hallo John,
> Thanks for your reply.
> Your first suggestion sounds interesting, but in that case the
> current ModelView matrix is on the stack and the spotlight then is
> at that positition. Instead of that, is it possible to place a
> spotlight in absolut world coordinates independent from the
> ModelView matrix in the nodeDrawCallback ? We need it for static
> lights in the scene. The position of the spotlight is not
> necessaryly the same as the position of the node in the callback.
Then you need to configure the ModelView with only
the viewing transformation. This requires you to nullify any
SCS/DCS transformations on the stack. I suggest you
call getmatrix() in your channel DRAW callback before calling
pfDraw() to get the viewing matrix. Then in the node pre-DRAW callback,
load this matrix before calling pfLightOn.
> Another try was to use pfLightSource instead of pfLight, but there
> was absolutely no effect of pfLightOff and pfLightOn. Are these
> functions ignored in nodeDrawCallbacks ?
Yes. In the DRAW process the pfLightSource node no longer
has effect.
This archive was generated by hypermail 2.0b2
on Mon Aug 10 1998 - 17:50:39 PDT