hoshi55
06-13-2001, 04:25 AM
i'm a bit confused by a positional light source... i tarnsform my whole modelview matrix with the inverse camera transformations, then draw lots off objects/stuff, which works fine.
in addition to the directioanl source that lights the scene, i´ve also included a positional with fixed coords. however, the light source never seems to be at the right place, although its positin is transformed by the matrix stack. i know that the x,y,z coords of a directional source are always multiplied by -1, but for a positional??
one more problem, light attenuation does not seem to work correctly. looking at the attenuation formula, i suppose that a factor of about 2.0 for linear attenuation should be ok to create a light that fades quite soon if distance increases, but the intensity always stays the same no no matter how tall my attenuation factor is.
in addition to the directioanl source that lights the scene, i´ve also included a positional with fixed coords. however, the light source never seems to be at the right place, although its positin is transformed by the matrix stack. i know that the x,y,z coords of a directional source are always multiplied by -1, but for a positional??
one more problem, light attenuation does not seem to work correctly. looking at the attenuation formula, i suppose that a factor of about 2.0 for linear attenuation should be ok to create a light that fades quite soon if distance increases, but the intensity always stays the same no no matter how tall my attenuation factor is.