lights

New Message Reply Date view Thread view Subject view Author view

Ken Lindsay (kl++at++shannon.arc.nasa.gov)
Sat, 11 Dec 1999 11:28:46 -0800 (PST)


hi,

i had 5 lights in my pfScene which worked fine until i did
something (not sure what i changed) which appears to make
all the light either come from below (as if they were all
at (0,0,0) but they aren't) for some of the objects and be
attached to the underside of the aircraft for my moving
object, and all point straight down for other objects.
i've fiddled with pfLSourcePos() for the lights and it
seems to have no effect. i've moved my addLights() which
adds the child to the pfScene to the first, middle and last
positions of building the scene (adding children). none of
these has any effect. removing the addLights() does remove
them, tho there is still one light coming in on the belly of
the aircraft from my multigen file. so i added a couple more
lights in the multigen file at different angles (i.e. the
effect i wanted looked ok in multigen) but that doesn't
come into performer correctly. there's only one light.

i inserted a couple of pfFlatten()'s in the routine that
loads and position the multigen files. would that affect it?

here's the addLights():

pfNode *addLights(void) {
   pfLightSource *Sun,*UpFill,*UpFill2,*sky_1,*sky_2,*sky_3;
   pfGroup *lights = pfNewGroup();
   Sun = pfNewLSource();
   pfLSourceColor(Sun,PFLT_DIFFUSE,0.5f,0.47f,0.4f);
   pfLSourceColor(Sun,PFLT_AMBIENT,0.1f,0.05f,0.01f);
   pfLSourcePos(Sun,0.2,0.2,1.0,0.0f);
   pfAddChild(lights, Sun);

... and so on for the other lights with these values for pos

   pfLSourcePos(sky_1,-1.0,0.3,0.2,0.0f);
   pfLSourcePos(sky_2,1.0,-0.83,0.2,0.0f);
   pfLSourcePos(UpFill,-1.0f,-0.2f,-0.5f,0.0f);
   pfLSourcePos(UpFill2, 1.0f, 0.8f, -0.6f, 0.0f);

thanks

ken

-==-

ken "fire a few neurons" lindsay kl++at++mars.arc.nasa.gov
NASA Ames Research Center Caelum Research Corp
Bldg 269, Room 281 (650) 604 0461 (lab)
Mail Stop 269-1 (650) 604 3594 (fax)
Moffett Field, CA 94035-1000 (650) 604 3181 (vox)

     When inlaws are outlawed, only outlaws will have inlaws


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Sat Dec 11 1999 - 11:28:57 PST

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