Difference between vtkViewProxy and vtkOpenGLRenderWindow

Hi I have been following the tutorial ImageStream for VTK.js and I couldn’t get it to work because I got some errors with the renderWindow methods.
So I started checking the code for react-vtk-js and paraview-lite to see what each project does for renderWindow and I noticed this difference. One uses vtkViewProxy and the other vtkOpenGLRenderWindow. I couldn’t find any explanation on why would I use one over the other. Could someone please help me understand? My ultimate goal would be to replicate the example for ImageStream.

vtkOpenGLRenderWindow is meant for letting vtk.js do the rendering using WebGL, while vtkRemoteView is for letting a server send an image to the client using the ImageStream mechanism.
The vtkViewProxy is just a wrapping around RenderWindow/GLRenderWindow/Interactor/Style…
In general, you can connect a vtkOpenGLRenderWindow to an ImageStream, but in that setup if you don’t plan to render any 3D locally, you can use a more light weight RW by using the vtkRemoteView.

You can find a better example than ParaViewLite for that remote view here.



1 Like

Thank you very much, it certainly helped! I managed to get a very weird rendering but it is working at least :slight_smile:

Just leaving a note for anyone who might use React + VTK.JS/Paraview. You might want to have a look at GitHub - thewtex/craco-vtk: A plugin for craco to use vtk.js with create-react-app, it worked out of the box for me.