[vtkusers] Lights - HELP!!!

James C. Robinson j.robinson at kepler.ie
Wed Nov 20 06:46:58 EST 2002


Dear All,  

I am starting to lose my patience (which will help nobody, especially me)
with this. I have abandoned the vtkLightKit, I just can't get it to light my
mesh (it lights other objects in the scene, no problem, such as a contour
filter, or a spheresource, but not the mesh). I decided to add my own three
lights, based on the vtkLightKit three lights, but without the fancy
"warmth" control. Here is the code that I added to my CView window:

  KeyLight = vtkLight::New();
  FillLight = vtkLight::New();
  Headlight = vtkLight::New();

  // initialize values
  this->KeyLight->SetLightTypeToCameraLight();
  this->FillLight->SetLightTypeToCameraLight();
  this->Headlight->SetLightTypeToHeadlight();

  KeyLight->SetDirectionAngle(50.0, 10.0);
  FillLight->SetDirectionAngle(-75.0, -10.0);


This is copied (almost) directly from vtkLightKit. I then add them later in
the OnCreate of the CView:

    this->Renderer->AddLight(KeyLight) ;
    this->Renderer->AddLight(FillLight) ;
    this->Renderer->AddLight(Headlight) ;

The resulting behaviour is bizarre. I attach a series of screen shots. The
first view shows the plan of the mesh which isn't lit quite right. The
second view shows that the mesh "lights up" after a very slight rotation. As
I progress the rotation, the lighting on the top surface disappears, only to
appear suddenly again.

If anybody has any ideas I would very much appreciate them. Hopefully, I am
doing something dumb that is easily rectified.

Jim
______________________

James C. Robinson, PhD,
Chartered Engineer,
Kepler Engineering Software Ltd.,
42 Rivergrove, 
Glanmire, Co. Cork,
Eire

Tel:         +353-21-4822028
Tel:         +353-87-2393010
Fax:        +353-21-4822721
E-mail:     j.robinson at kepler.ie
______________________

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 27195 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20021120/28bccfd2/attachment.bin>


More information about the vtkusers mailing list