rvandepo++at++csc.com
Thu, 11 Nov 1999 17:08:02 +1000
Any feedback would be welcome!
Thanks,
Rene
-----
The code I have been using is given below
tex = new pfTexture;
tex->loadFile("spotlight.inta");
frust = new pfFrustum;
frust->makeSimple(60.0f);
frust->setNearFar(1.0f, 1000.0f);
lamp = new pfLightSource;
lamp->setAttr(PFLS_PROJ_TEX. tex);
lamp->setAttr(PFLS_PROJ_FRUST, frust);
lamp->setMode(PFLS_PROJTEX_ENABLE, 1);
lamp->setPos(0.0f, 0.0f, 1.0f, 1.0f); // w = 1.0f for local light
lamp->setDir(0.0f, 1.0f, -1.0f); // I tried a few combinations
dcs = new pfDCS;
dcs->addChild(lamp);
scene->addChild(dcs);
dcs->setCoord(coord); // coord is a pfCoord with the eye point coordinates
lm = new pfLightModel;
lm->setLocal(PF_ON);
lm->apply();
//pfOverride(PFSTATE_LIGHTMODEL, PF_ON);
pfEnable(PFEN_LIGHTING);
//pfOverride(PFSTATE_ENLIGHTING, PF_ON);
// Modelview matrix corresponds to a view in the y direction
// pfMaterial has been applied
// Geometry has got normals
lamp->on();
Draw scene
This archive was generated by hypermail 2.0b2 on Thu Nov 11 1999 - 07:39:54 PST