[vtkusers] linux + wxpython : Multiple wxVTKrenderWindows problem

David Gobbi dgobbi at irus.rri.ca
Tue Feb 12 17:03:11 EST 2002


On Tue, 12 Feb 2002, Bob Lewis wrote:

> I thought it was just me, but a similar kind of behavior happened when
> I tried (in Python) to put two vtkRenderWidgets in a Tk frame.  One of
> them behaved normally, but the other did not respond to trackball
> interaction and displayed garbage when the window was resized.

For the most part, the vtkRenderWidget behaves well for me under nearly
all conditions as long as the OpenGL drivers are working fine.  But one
big problem I've had especially on SGI machines is the buffer swapping
when there are multiple widgets (or even just multiple RenderWindows).
Whenever I have multiple RenderWindows, my render sequence is as follows:
I turn SwapBuffersOff() in all windows, call Render() on all windows,
call SwapBuffersOn() in all windows, call Frame() on all windows.
This ensures that the back->front buffer swapping is properly
synchronized.  A simpler fix is often to just to configure the OpenGL
drivers to do a pixel copy instead of a buffer swap.  Or to use multiple
Renderers inside the same Window/Widget.

> As a VTK novice, I decided that VTK was one of those systems where a
> good deal of time at the low end of the learning curve is spent
> learning (a) not to do things that are too weird and (b) what
> constitutes "too weird".

Eventually nothing is really "too weird."  Perhaps one of my biggest
complaints about VTK is that it does a really lousy job of buffering
the users from the nitty-gritty internals.  It really is necessary to
look under to hood sometimes to figure out what is going on.  But once
you get the hang of it there is a lot of power to play with.

> This was 3.2.  Maybe it's been fixed in 4.0, but I'm not likely to try
> it.  It's just too weird.

That part of VTK hasn't changed since 3.2 as far as I know.  However
OpenGL drivers have gotten much better over the last couple years,
particularly under Win2000 and Linux.

 - David





More information about the vtkusers mailing list