[vtkusers] viewport problems

Mathieu Malaterre mathieu.malaterre at kitware.com
Wed Apr 28 16:14:11 EDT 2004


Clinton,

	[CCing the vtkusers list]

	I think this is related to the renumbering of the layers:

http://vtk.org/pipermail/vtkusers/2004-February/022036.html

[The reason for changing the ordering of the layer numbers is that in
previous versions of VTK the ordering seemed exactly backwards.  In the CVS
version of VTK, layer 0 is now the opaque layer, and successively higher
layer numbers are transparent layers on top of it.  The ordering of the
layer numbers is the order in which the renderers should be rendered (back
to front).  This is also a particularly helpful ordering if your
application is adding layers to the render window because only the new
transparent renderers need to be renumbered.  (In the previous version, to
add a transparent renderer over all the current renderers, every renderer
in the render window had to be renumbered.)
]


HTH
Mathieu

Clinton Stimpson wrote:
> Hi Mathieu,
> 
> Hope you don't mind me asking.  I'm getting some different behavior 
> between VTK 4.2 and the latest CVS, and I'm wondering if it was an 
> unintentional change.
> 
> Here's the python script to show the difference.
> 
> #!/usr/bin/env python
> 
> import vtk
> 
> renWin = vtk.vtkRenderWindow()
> 
> renWin.SetNumberOfLayers(2)
> 
> ren1 = vtk.vtkRenderer()
> ren1.SetBackground(1,1,1)
> ren1.SetLayer(0)
> renWin.AddRenderer(ren1)
> 
> ren2 = vtk.vtkRenderer()
> ren2.SetLayer(1)
> ren2.SetInteractive(0)
> renWin.AddRenderer(ren2)
> 
> 
> iren = vtk.vtkRenderWindowInteractor()
> iren.SetRenderWindow(renWin)
> 
> iren.Initialize()
> renWin.Render()
> iren.Start()
> 
> 
> In VTK 4.2, the window is black, and in VTK 4.5 it is white.  I want to 
> make sure I have the right renderer transparent.  I'd like my 
> non-transparent renderer to have backing store turned on for faster 
> renders in cases where I modify the data that is rendered to a 
> transparent renderer, but don't modify data drawn with my 
> non-transparent renderer.  Having the background color different told me 
> that the layers are somewhat different, and that some of my other stuff 
> might not work the same.
> 
> Clint
> 
> 
> 






More information about the vtkusers mailing list