[vtkusers] VTK in a MultiTouch Environment

David Gobbi david.gobbi at gmail.com
Fri Oct 23 16:27:21 EDT 2009


On Fri, Oct 23, 2009 at 6:33 AM, Christopher Denter
<dennda at the-space-station.com> wrote:
> Hello.
>
>> What is exactly is your "FBO"?  It it a PyMT object?  Any information
>> that you have about its internals would help the discussion.
>
> Yes, it is a PyMT object. You use it like this:
>
>>>> with fboobject:
>>>>     do_the_drawing()
>
> What this does is bind the FBO (which is an OpenGL Framebuffer), execute all
> the drawing code in the with-block and then unbind it again. You can then
> access the things you drew via the fboobject.
> It has a color buffer and a depth buffer.

Okay, I see now.  The fbo more-or-less sets the OpenGL state so that
any OpenGL drawing commands will draw into the framebuffer.
Unfortunately this won't work with the vtkRenderWIndow, because the
RenderWindow expects to start from scratch with a window and
initialize its own OpenGL context, right down to the operating system
level.  The RenderWindow can't be used with pre-existing OpenGL state
like that which is created by the fbo.

In short, the fbo is the wrong "level" at which to attach the
RenderWIndow.  The RenderWindow expects to be connected very close to
the operating system.  The fbo is couple levels too high.

The only way that you could work with the fbo is if you created your
own vtkRenderWidget class (in C++) that doesn't do any initialization,
and instead just clears the buffer and tells the renderers to draw
into it.  That would be a lot of work but it would do the trick.  The
idea is that this new RenderWindow would be connected at the OpenGL
level, rather than at the Window level.  A plus is that it would be
completely platform-independent, because it wouldn't have do anything
at the operating-system level: no HIView, X11, or Win32 code required.

I'm not sure if I explained it clearly, let me know if what I said
makes any sense.

   David



More information about the vtkusers mailing list