[vtkusers] diffuse lighting after scaling with negative values

Gerrick Bivins gbivins at objectreservoir.com
Wed Sep 3 15:11:14 EDT 2008



Hi Manuel,
You should just rotate your actor 180 degrees rather than using the scale.
This would avoid these kinds of problems.
Gerrick


On 9/3/08 1:55 PM, "Manuel Feige" <manuelfeige at googlemail.com> wrote:

> 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
> 
> 
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080903/c13ca03d/attachment.htm>


More information about the vtkusers mailing list