[vtkusers] Using vtkExternalOpenGLCamera

Gavin gavin.wheeler at kcl.ac.uk
Thu Mar 22 13:45:08 EDT 2018


I've been using vtkExternalXXXX to try and integrate VTK into Unity, so this
is a very interesting thread. However, the documentation and examples are a
bit thin, and so I found myself rather confused...

- I never realised a 'normal' camera and renderer can be used with the
external render window - the documentation really does not point to this
being a possibility. (Ditto the converse that an External Light needs to be
used - I wondered why the lighting I added had no effect)

I ended up deriving my own renderer class from vtkExternalOpenGLRenderer to
stop it overwriting the View and Projection matrices I'd set. I'll try using
the vtkOpenGLRenderer instead. I hope I can use the vtkExternalOpenGLCamera
with this class - this is the one which adds the methods to set the View and
Projection matrices. As I say I found it really unclear that if you use the
vtkExternalOpenGLCamera to set the View and Projection Matrices they'll be
overwritten if you also use vtkExternalOpenGLRenderer.

- I never had any success getting vtkExternalOpenGLRenderer to acquire
correct view and projection matrices

I'm no OpenGL expert, so bear with me if I have totally the wrong idea here.
When I look at the latest documentation for OpenGL (V4.6) the calls...

  glGetDoublev(GL_MODELVIEW_MATRIX,mv);
  glGetDoublev(GL_PROJECTION_MATRIX,p);

...as used in vtkExternalOpenGLRenderer::Render(void) don't appear to be
supported. glGetDoublev is a function but GL_MODELVIEW_MATRIX and
GL_PROJECTION_MATRIX are not defined - see
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGet.xhtml

However, they do seem to be defined for OpenGL 2.1
https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glGet.xml

Which to me makes sense as I understand the pipeline is user defined for
OpenGL 3+ but was defined OpenGL 2.X

So, am I wrong in thinking that vtkExternalOpenGLRenderer will only work
with older versions of OpenGL? That's how it appears to me, I've found
nothing to say what versions are(n't) supported. If I am wrong, please
correct me and explain why - I'm keen to learn more about how this all works
and to help in my future development.

Thanks, G




--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html


More information about the vtkusers mailing list