[vtkusers] VTK in a MultiTouch Environment

Christopher Denter dennda at the-space-station.com
Thu Oct 22 17:47:38 EDT 2009


Hello again!

After my last mail to this list we have been able to make some progress.
We still aren't able to render directly into a FBO and it still does  
not work on OSX or Windows (not confirmed, that is).
However, we found a workaround that might just work for the moment. I  
would love to hear your thoughts.

Please see this small video (1MB):
http://the-space-station.com/~dennda/gallery/mt/proofofconceptVTKMT.ogv

We did this by first making VTK render in its own window, then we  
grabbed that window's colorbuffer as a texture and applied it to a  
rectangle in the real multitouch application. You can see the helper  
window come up just before the real application starts. As you can see  
we are able to rotate, scale and translate the VTKWidget (our  
terminology) just like any other widget pymt has.

Take a look at our proof of concept code:
http://paste.pocoo.org/show/146495/

This shows the heart of the workaround. Save it as vtkwidget.py and in  
the same folder, save the following code:
http://paste.pocoo.org/show/146496/

Assuming you have both VTK (with python bindings) and pymt installed,  
you can now try this for yourself if you want.

Now again, this is just a workaround that I consider using until  
someone has a better (and faster, and cross-platform) idea.
It would be great if this could work on Windows and OSX as well. We  
were unable to get the id of the HIView of the helper window. If  
someone wants to shed some (more) light, I'd certainly appreciate it.

I have not tested the code on Windows since that'd require compiling  
VTK with python bindings and I have no experience with compiling  
things on that platform.

David wrote:
> If you only have
> the pointer to the Carbon window, then you would have to use the
> vtkCarbonWindow::SetRootWindow() method which is only useful
> from C++ (it could be easily made useful in Python, though).

How to make it useful in Python?

Thank you for your time and patience. Your expertise is really  
appreciated.

I would love to hear your opinion on this,
	Christopher



More information about the vtkusers mailing list