<div dir="ltr">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. <div><br></div><div>But I have heard of people doing something like what you described, but maybe they are using the vtkGenericOpenGLRenderWindow instead.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 22, 2018 at 1:45 PM, Gavin <span dir="ltr"><<a href="mailto:gavin.wheeler@kcl.ac.uk" target="_blank">gavin.wheeler@kcl.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I've been using vtkExternalXXXX to try and integrate VTK into Unity, so this<br>
is a very interesting thread. However, the documentation and examples are a<br>
bit thin, and so I found myself rather confused...<br>
<br>
- I never realised a 'normal' camera and renderer can be used with the<br>
external render window - the documentation really does not point to this<br>
being a possibility. (Ditto the converse that an External Light needs to be<br>
used - I wondered why the lighting I added had no effect)<br>
<br>
I ended up deriving my own renderer class from vtkExternalOpenGLRenderer to<br>
stop it overwriting the View and Projection matrices I'd set. I'll try using<br>
the vtkOpenGLRenderer instead. I hope I can use the vtkExternalOpenGLCamera<br>
with this class - this is the one which adds the methods to set the View and<br>
Projection matrices. As I say I found it really unclear that if you use the<br>
vtkExternalOpenGLCamera to set the View and Projection Matrices they'll be<br>
overwritten if you also use vtkExternalOpenGLRenderer.<br>
<br>
- I never had any success getting vtkExternalOpenGLRenderer to acquire<br>
correct view and projection matrices<br>
<br>
I'm no OpenGL expert, so bear with me if I have totally the wrong idea here.<br>
When I look at the latest documentation for OpenGL (V4.6) the calls...<br>
<br>
glGetDoublev(GL_MODELVIEW_<wbr>MATRIX,mv);<br>
glGetDoublev(GL_PROJECTION_<wbr>MATRIX,p);<br>
<br>
...as used in vtkExternalOpenGLRenderer::<wbr>Render(void) don't appear to be<br>
supported. glGetDoublev is a function but GL_MODELVIEW_MATRIX and<br>
GL_PROJECTION_MATRIX are not defined - see<br>
<a href="https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGet.xhtml" rel="noreferrer" target="_blank">https://www.khronos.org/<wbr>registry/OpenGL-Refpages/gl4/<wbr>html/glGet.xhtml</a><br>
<br>
However, they do seem to be defined for OpenGL 2.1<br>
<a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glGet.xml" rel="noreferrer" target="_blank">https://www.khronos.org/<wbr>registry/OpenGL-Refpages/gl2.<wbr>1/xhtml/glGet.xml</a><br>
<br>
Which to me makes sense as I understand the pipeline is user defined for<br>
OpenGL 3+ but was defined OpenGL 2.X<br>
<br>
So, am I wrong in thinking that vtkExternalOpenGLRenderer will only work<br>
with older versions of OpenGL? That's how it appears to me, I've found<br>
nothing to say what versions are(n't) supported. If I am wrong, please<br>
correct me and explain why - I'm keen to learn more about how this all works<br>
and to help in my future development.<br>
<br>
Thanks, G<br>
<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.<wbr>com/VTK-Users-f1224199.html</a><br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://vtk.org/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://vtk.org/mailman/<wbr>listinfo/vtkusers</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Ken Martin PhD<div>Distinguished Engineer<br><span style="font-size:12.8px">Kitware Inc.</span><br></div><div>28 Corporate Drive<br>Clifton Park NY 12065<br><div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">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.</span></div></div></div></div></div>
</div>