[SOLVED] Using a vtk renderer in QtQuick
-
wrote on 14 Feb 2013, 13:04 last edited by
Its not working without the push and pop (nothing is rendered, only the background). Unfortunatelly I cannot tell you why, I'm no OpenGL expert.
-
wrote on 18 Feb 2013, 16:01 last edited by
I think I understand why.
The only problem is GLES doest support those functions so how do we get around them?Maybe I should make a new thread to this issue?
-
wrote on 5 Mar 2013, 01:48 last edited by
I found a new way of solving this problem.
It Involves setting up a separate opengl context and switching between the two before and after binding and releasing the fbo.
Any idea how to draw correctly for a y inverted fbo.
On qquickpainteditem we can set it to flip but not for the qsgtexture :/ -
wrote on 5 Mar 2013, 08:41 last edited by
Hey, thanks for your reply. Can you provide some code how you do that?
In my case, it also seems to be the cleanest way to do the same thing and I wan't to try that. :-)For the flipping problem I would naivly just scale (glScale) the y-Axis with -1. But as I mentioned, I'm no OpenGL expert.
-
wrote on 11 Mar 2013, 09:51 last edited by
Hey z.emb
I used what was on this thread.
http://qt-project.org/forums/viewthread/25268/
I just changed this line for the flip y.
QSGGeometry::updateTexturedRectGeometry(&m_geometry,
QRectF(0, 0, m_size.width(), m_size.height()),
QRectF(0, 0, 1, 1));to
QSGGeometry::updateTexturedRectGeometry(&m_geometry,
QRectF(0, 0, m_size.width(), m_size.height()),
QRectF(0, 1, 1, -1));//0011 = old y fliped -
wrote on 11 Mar 2013, 09:55 last edited by
Can you give me some code how you switched the GL-context?
-
wrote on 28 May 2013, 16:29 last edited by
Hey Guys,
Apologies about not replying.
I didn't realize I got a response.I swapped the context at the very beginning by using the code in this thread
http://qt-project.org/forums/viewthread/25268/
Hope that helps Ricky, just got your pm.
Many Thanks
Martell -
wrote on 2 Jan 2014, 13:44 last edited by
Hi,
I still did not get it.
Could you, please, anyone post a full example about rendering vtk to qtquick?
I was trying to understand the discussion but I did not get through...Best regards,
radek
-
wrote on 2 Feb 2014, 12:13 last edited by
Hey, I join to this request. Even the simplest example would be helpful.
Regards,
rafal -
wrote on 11 Jul 2018, 17:07 last edited by
I have created a repository with code that integrates VTK with Qt QuickControls 2, tested with VTK 8 and Qt 5.9. You can find the code here https://github.com/nicanor-romero/QtVtk with building instructions in the README. Also a brief article about it,
https://blog.bq.com/es/integrating-qtquickcontrols-2-with-vtk/