[vtkusers] Re: dark printing and clipboard

Nigel Nunn nNunn at ausport.gov.au
Tue Apr 15 10:54:12 EDT 2003


Hi Paul, 
 
I've also struck the problem of images rendering fine on-screen 
but losing their user-defined lighting when rendered off-screen. 
e.g. into the clipboard.  One place damage may occur is here: 
 
void vtkOpenGLRenderer::DeviceRender(void) 
{
  this->RenderWindow->MakeCurrent(); 
  this->ClearLights();                  <--- clears all lights! 
  this->UpdateCamera();
  this->UpdateLightGeometry();
  this->UpdateLights();             <--- not properly restored? 
  glMatrixMode(GL_MODELVIEW);
  this->UpdateGeometry();
  glMatrixMode(GL_MODELVIEW);
  glPopMatrix();
}
 
If no user-defined lights are active, then UpdateLights() adds 
a headlight and at least there is some light in the image.  But 
(guessing here) if we have added a custom set of lights, then 
these are lost in the call to ClearLights(); but not restored 
in UpdateLights().  And since there is a "non-zero" number of 
lights, the default headlight is not added, and scene is dark. 
 
My (solution :-) when making movies, is to turn off light-kits 
or other user-defined lights, and adjust the scene to be visible 
with just the default headlight (which is better than nothing). 
If I get time, I plan to build a debug Vtk and trace this. 
 
Hope you can find a better fix! 
Nigel 
 
> I am displaying 2 surfaces made up of triangles. Hence the 
> top & bottom lut which use scalars attached to each surface. 
> I'm using the vtlLightinghKit so my theory is that the surfaces 
> have an "intrinsic" color which is changed (lightened) by the 
> lighting kit to produce what I see on the screen. When I print 
> only get those "intrinsic" colors. Thats why the 2D scale bar 
> gets displayed ok..... I think
> 
> So how do I get vtk to give me the post processed pixels for 
> printing? 
> 
> Hi
> 
> VTK 4.0
> 
> I'm trying to get my MFC printing working
> 
> I'm using pretty much the same code as in the examples and 
> I've implemented clipboard copying but in both cases my plots 
> come out dark
> 
> I also print out a vtkScalarbarActor which displays perfectly, 
> so I know i'm doing something wrong
 
 

**********************************************************************
This message is intended for the addressee named and may contain 
confidential and privileged information. If you are not the intended 
recipient please note that any form of distribution, copying or use of
this communication or the information in it is strictly prohibited and
may be unlawful. If you receive this message in error, please delete it
and notify the sender.

Keep up to date with what's happening in Australian sport.
Visit http://www.ausport.gov.au
**********************************************************************



More information about the vtkusers mailing list