[vtk-developers] vtkBoxRepresentation outline color

Sujin Philip sujin.philip at kitware.com
Thu Oct 20 15:33:39 EDT 2016


Hi Chris,

This looks like a lighting issue. The representation sets its ambient color
to full white. Setting the ambient coefficient to 0.0 seems to produce
expected results.
boxRep.GetOutlineProperty().SetAmbient(0.0)

Thanks
Sujin


On Thu, Oct 20, 2016 at 3:06 PM, Chris Harris <chris.harris at kitware.com>
wrote:

> We are using vtkBoxRepresentation in tomviz to perform cropping. The
> outline color defaults to white, which is not so good for a white
> background! So we are trying to set it to an off white (0.8, 0.8, 0.8)
> However, the value gets rendered as white? What am I missing? Here is the
> python code to recreate this issue
>
> import vtk
>
> ren = vtk.vtkRenderer()
> ren.SetBackground(1,1,1)
>
> renWin = vtk.vtkRenderWindow()
> renWin.AddRenderer(ren)
>
> iren = vtk.vtkRenderWindowInteractor()
> iren.SetRenderWindow(renWin)
>
> boxRep = vtk.vtkBoxRepresentation()
> boxRep.SetPlaceFactor(1.0)
> boxRep.HandlesOn()
> boxRep.GetOutlineProperty().SetColor(0.8, 0.8, 0.8)
>
> boxWidget = vtk.vtkBoxWidget2()
> boxWidget.SetInteractor(iren)
> boxWidget.SetRepresentation(boxRep)
> boxWidget.SetPriority(1)
> boxWidget.On()
>
> iren.Initialize()
> renWin.Render()
> iren.Start()
>
>
> Thanks,
>
> Chris
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtk-developers
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20161020/08b7e351/attachment.html>


More information about the vtk-developers mailing list