[info-performer] pfLightSource transformations

New Message Reply Date view Thread view Subject view Author view

From: pffffff (csklu_pf++at++yahoo.com)
Date: 02/25/2003 22:45:52


I'm having trouble understanding how transformations
are applied to pfLightSources in my scene graph.
Unfortunately I am still using performer2.2 due to
project requirements (however with compatibility libs
from pf2.5). In particular, pfLightSource::setPos()
and setSpotDir() set the position and direction of a
spotlight, but if I place the LightSource under a DCS,
the DCS should also modify the position and direction,
right?

For example:

pfScene * scene = new pfScene;
pfDCS * dcs = new pfDCS;
pfLightSource * ls = new pfLightSource;
dcs->addChild(ls);
scene->addChild(dcs);

// Set local lsource position, this works fine
ls->setPos(0.0, 0.0, 0.0, 1.0);
// spotlight points upwards
ls->setSpotDir(0.0, 0.0, 1.0);

float heading = 90.0, pitch = 0.0, roll = 0.0;
// Using these has no effect
dcs->setTrans(10.0, 0.0, 0.0);
dcs->setRot(90.0, 0.0, 0.0);

// Doing this does something, but not what I expected
pfMatrix mat;
mat.makeEuler( heading, pitch, roll ); // does nothing
mat.setRow(3, 10.0, 0.0, 0.0, 1.0 ); // seems to be
same as setSpotDir()
dcs->setMat(mat);

Q: What is supposed to be the effect of the dcs for
infinite lightsources, i.e. ls->setPos(x,y,z.0.0); ?

Q: How do I make a local light source? (i.e. with a
position and shining in all directions)

Q: I am also using the shadow functionality of
lightsources and the image in the projected shadow
seems to be transformed from when scene when viewed
from the point of view from the light, but I suspect
that may have to do with the above transformation
problems.

I have also looked at the shadows.c example and there
it just does setPos(0,0,0,1) and never does
setSpotDir() and does transformations on the matrix
using the yaxis. I'll try replicating that but I
thought that using the methods on dcs should also
work.

Thanks,
Chris

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Feb 25 2003 - 22:46:11 PST

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