Hugo Eide Gunnarsen (hugogu++at++hugogu.oslo.sgi.com)
Sun, 7 Dec 1997 19:20:03 +0100
After reading manual page for pfLightSource and about Spotlights in the
book,
this is what I came up with :
pf_tex=new pfTexture();
pf_tex->loadFile("spot.inta");
pf_frust=new pfFrustum();
pf_frust->makeSimple(60.0f);
pf_frust->setNearFar(1.0f,10.0f);
pf_spot=new pfLightSource();
pf_spot->setMode(PFLS_PROJTEX_ENABLE,PF_ON);
pf_spot->setAttr(PFLS_PROJ_TEX,pf_tex);
pf_spot->setAttr(PFLS_PROJ_FRUST,pf_frust);
pf_spot->setVal(PFLS_INTENSITY,.5f);
pf_spot->setAtten(1,0,0);
pf_spot->setPos(0,-0.75,0,1);
pf_spot->setSpotDir(0,1,0);
pf_spot->setSpotCone(1,30);
pf_spot->setColor(PFLT_DIFFUSE,0,1,0);
pf_spot->setColor(PFLT_AMBIENT,0,0,1);
pf_spot->setColor(PFLT_SPECULAR,1,0,0);
pf_rot=new pfDCS();
pf_rot->addChild(pf_spot);
pf_scene->addChild(pf_rot);
However, it does not seems like the frustum nor the textures make any
changes in my program. I even removed the section from PFLS_INTENSITY and
down to PFLT_SPECULAR to get the code similar to the example in the man
page, but it still did not look good (looked like a local light).
So if any one of you out there have done this I would really be interested
in knowing how to fix this.
Thanks.
--Hugo Eide Gunnarsen Mob: +47 92887631 If it ain't broke, hugogu++at++oslo.sgi.com Work: +47 67114631 it doesn't have Silicon Graphics AS Direct: +47 67114600 enough features yet.
No fortune generated, out of luck.
======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:56:21 PDT