Ekkehard Klaerner (EK++at++AITEC.de)
Thu, 3 Nov 1994 10:43:38 GMT+1
1) Is there any way to limit the influence of a pfLightSource to the
objects within its bounding-volume ?
2) Does the limitions of 8 GL-Lightsources refer to a pfChannel or a
pfPipe ?
3) Another solution could be to illuminate just certain objects of the
scene. To get this I wrote another nodeDrawCallback-function for a
certain object (node), where I switch the respective lightsources
on. These are the sources of the pre- und post-callback:
/* Pre Node DRAW Callback for lighting */
long preDrawLight(pfTraverser *trav, void *data)
{
pfVec3 xyz, hpr;
int i;
userNodeDataTyp *myData =
(userNodeDataTyp*)pfGetUserData(pfGetTravNode(trav));
ASSERT(myData);
pfPushIdentMatrix();
for (i=0; i<shared->nSpotLs; i++) {
pfLightPos(shared->spotLs[i],0,0,0,1); // for testing
pfLightOn(shared->spotLs[i]);
}
pfPopMatrix();
/* normal continue */
return(PFTRAV_CONT);
}
/* Post Node Draw Callback */
long postDrawLight(pfTraverser *trav, void *data)
{
int i;
for (i=0; i<shared->nSpotLsAll; i++) {
pfLightOff(shared->spotLs[i]);
}
// pfPopMatrix();
return(PFTRAV_CONT);
}
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 ?
Thanks,
Ekki
AITEC GmbH & CO Informationstechnologie KG
Ekkehard Klaerner
Alter Hellweg 50
D-44379 Dortmund
GERMANY
Tel.: +49 231 9646545
Fax.: +49 231 9646598
EMail: ek++at++aitec.de
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:38 PDT