[vtkusers] Using vtkExternalOpenGLCamera

Ken Martin ken.martin at kitware.com
Thu Mar 22 16:37:17 EDT 2018


At least pieces of that code look out of date as the matrix and lighting
ops definitely will no longer work with the new OpenGL2 3.2 based backend.

But I have heard of people doing something like what you described, but
maybe they are using the vtkGenericOpenGLRenderWindow instead.

On Thu, Mar 22, 2018 at 1:45 PM, Gavin <gavin.wheeler at kcl.ac.uk> wrote:

> 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
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtkusers
>



-- 
Ken Martin PhD
Distinguished Engineer
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065

This communication, including all attachments, contains confidential and
legally privileged information, and it is intended only for the use of the
addressee.  Access to this email by anyone else is unauthorized. If you are
not the intended recipient, any disclosure, copying, distribution or any
action taken in reliance on it is prohibited and may be unlawful. If you
received this communication in error please notify us immediately and
destroy the original message.  Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180322/f396791b/attachment.html>


More information about the vtkusers mailing list