[vtkusers] how to make an attenuate light in VC++

c v covkmhk at yahoo.com
Tue May 28 02:34:57 EDT 2002


HI ereryone,

I tried to make an attenuate light in VC++. I used the
Sample of VC of vtk.
Here are  the codes  I wrote. But the  image showed 
dose not change. However, when I 
debuged into the codes, the value such as 
AttenuationValue  in  "*rpLight"  changed as I
defined.
Why didnot  the values take effect ? And how to make 
a attenuate light?
 
Thanks 
 
Colin
 
 
 vtkLightCollection  *ploghtcoll;
 vtkLight *rpLight;
 
 ploghtcoll= this->Renderer->GetLights();
 
 int tot;
 tot  = ploghtcoll->GetReferenceCount ();
 
 tot= ploghtcoll->GetNumberOfItems() ;
 ploghtcoll->InitTraversal ();
 
 rpLight=ploghtcoll ->GetNextItem ();

 while(rpLight!=NULL)
 {
  float dd[3];
 
  rpLight->GetAttenuationValues (dd);
  
  rpLight->PositionalOn ();
 
  rpLight->SetAttenuationValues(9,9,9);
 
  rpLight->GetAttenuationValues (dd);
 
  rpLight->SetConeAngle(5);
  
  rpLight->SetLightTypeToHeadlight();
 
  rpLight->SetLightTypeToSceneLight ();
  rpLight->SetLightTypeToCameraLight ();
  rpLight->SetLightTypeToHeadlight ();
 

  rpLight->Modified();
  
 
  rpLight= this->Renderer->GetLights()->GetNextItem
();

 
 }


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com



More information about the vtkusers mailing list