[vtkusers] diffuse lighting after scaling with negative values

Manuel Feige manuelfeige at googlemail.com
Wed Sep 3 14:55:25 EDT 2008


Hello,

my application needs to mirror the actors with respect to the x-y-plane. I can do this by vtkProp3D::SetScale(1, 1, -1). Unfortunately the diffuse lighting does not work after this transformation (the ambient lighting does). In this example the cone appears gray instead of white.

int main()
{
vtkConeSource* cone = vtkConeSource::New();
vtkDataSetMapper* mapper = vtkDataSetMapper::New();
mapper->SetInput(cone->GetOutput());

vtkActor* actor = vtkActor::New();
actor->SetMapper(mapper);
actor->GetProperty()->SetRepresentationToSurface();
actor->GetProperty()->SetColor(1.0, 1.0, 1.0);
actor->GetProperty()->SetAmbient(0.5);
actor->SetScale(1,1,-1);

vtkRenderer* renderer = vtkRenderer::New();
renderer->AddActor(actor);
vtkRenderWindow* renWin = vtkRenderWindow::New();
renWin->AddRenderer(renderer);
vtkRenderWindowInteractor* iren = vtkRenderWindowInteractor::New();
iren->SetRenderWindow(renWin);
iren->Initialize();
iren->Start(); 

//Delete...
}

Any suggestions how I can get the diffuse lighting running?

Thanks in advance
Manuel Feige
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080903/ba2904e3/attachment.htm>


More information about the vtkusers mailing list