[vtkusers] Bug in vtk opengl light

Carsten Kübler kuebler at ira.uka.de
Wed Dec 19 10:45:53 EST 2001


Hej,

GL_SPOT_CUTOFF is defined in the range [0,90] and 180 but not ]90,180[

    // set up spot parameters if neccesary
    if (this->ConeAngle < 180.0)
      {
      Info[0] = dx;
      Info[1] = dy;
      Info[2] = dz;
      glLightfv((GLenum)light_index, GL_SPOT_DIRECTION, Info );
      glLightf((GLenum)light_index, GL_SPOT_EXPONENT, this->Exponent);
      glLightf((GLenum)light_index, GL_SPOT_CUTOFF, this->ConeAngle);
      }
    else
      {
      glLighti((GLenum)light_index, GL_SPOT_CUTOFF, 180);
      }


which is the right solution?
      glLightf((GLenum)light_index, GL_SPOT_CUTOFF, this->ConeAngle);
     -->
      glLightf((GLenum)light_index, GL_SPOT_CUTOFF, this->ConeAngle/2);

      if (this->ConeAngle < 180.0)
     -->
      if (this->ConeAngle < 90.0)


Carsten

-- 
Dipl.-Inf. Carsten Kübler

Institute for Process Control & Robotics  
Universität Karlsruhe (TH)	Tel.:  +49 721/608-8934 
Kaiserstr. 12			Fax.:  +49 721/608-7141
D-76128 Karlsruhe		Email: kuebler at ira.uka.de
Germany				WWW:   http://wwwipr.ira.uka.de/~kuebler/





More information about the vtkusers mailing list