[vtkusers] Transparent vtkRenderer with Qt

Francois Bertel francois.bertel at kitware.com
Wed Apr 28 09:42:46 EDT 2010


Hello Guillaume,

First you need a renderwindow with some alpha (this is false by default):

vtkRenderWindow *renWin = vtkRenderWindow::New();
renWin->SetAlphaBitPlanes(1);

There is no API to set a specific opacity on the background color,
however, the hardcoded alpha value is 0 (this actual code is in
VTK/Rendering/vtkOpenGLRenderer::Clear() ), if your use case is to
have a fully transparent background.

Still in the case of a fully transparent background, the other way to
set it, is to assign the layer of the renderer to be a value greater
than 1. By default it is 0, a value greater than 1 will set the
renderer on an overlay. (see vtkRenderer::SetLayer() )



On Wed, Apr 28, 2010 at 8:21 AM, Guillaume DARDENNE
<guillaume.dardenne at telecom-bretagne.eu> wrote:
> Dear Vtk users,
>
>
>
> I insert a vtk widget in a Qt widget with the QVtkWidget class.
>
> I would like to make the vtkWidget transparent.
>
> I know that it’s possible to set the backward color with the
> setRendererBackground(double, double, double) function but is it possible to
> set also the opacity of this renderer window ?
>
>
>
> Thank you very much for your answers.
>
>
>
> Guillaume
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtkusers mailing list