wrote a G3DWidget for use in Qt applications. got it working. screenshot attached.

119 views
Skip to first unread message

Mike Roberts

unread,
Apr 3, 2013, 10:00:43 AM4/3/13
to g3d-...@googlegroups.com
Hi friends,

I have been working on a G3DWidget for use in Qt applications over the past few days. I just got a proof-of-concept demo working, so I thought it would be fun to share a screenshot. The screenshot shows two different G3D::GApp instances rendering into the panes of a QDockWidget. In the bottom-right pane, there is a QWebView widget that is showing a zoomed out view of the G3D website.

I have designed the G3DWidget interface so it is easy to add to existing Qt applications. It is also straightforward to create multiple G3DWidgets and have them render different things (e.g., different scenes, or the same scene from different views, etc.). Each G3DWidget is bound to the same OpenGL context, so OpenGL resources (e.g., meshes, shaders, textures) can be shared across G3DWidgets with no additional code.

I still need to implement a few more methods from the G3D::OSWindow interface. After that, it would be great to get feedback on the code. I might be doing some stuff wrong. Anyway, I'll post my progress in this thread  :)

Cheers,
Mike
Screen Shot 2013-04-03 at 5.55.08 AM.png

EdwardP

unread,
Apr 3, 2013, 10:32:27 AM4/3/13
to g3d-...@googlegroups.com
Hi Mike,

That looks ace! I had a go at something similar a while ago (https://groups.google.com/group/g3d-users/browse_thread/thread/d7612a604ab46608#) and I for one would be very interested to see your implementation and compare notes. 

Cheers. E
Message has been deleted

Mike Roberts

unread,
Apr 3, 2013, 10:46:36 AM4/3/13
to g3d-...@googlegroups.com
Hi Edward,

Thanks for the kudos. I read your thread a few days ago and it gave me hope that Qt integration was possible. Hehe  :)  Did you get it the user input stuff working in the end? Was there anything that never ended up working? Also, is your code online?  :)

Cheers,
Mike

Morgan McGuire

unread,
Apr 3, 2013, 11:21:12 AM4/3/13
to g3d-...@googlegroups.com
Nice work!  Originally we distributed a QTWindow OSWindow subclass, but it was too much work for us to maintain and we removed it.  I'm glad to see it back.

-m


Prof. Morgan McGuire
Computer Science Department
Williams College
http://cs.williams.edu/~morgan


--
You received this message because you are subscribed to the Google Groups "G3D Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to g3d-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

EdwardP

unread,
Apr 5, 2013, 6:06:09 AM4/5/13
to g3d-...@googlegroups.com
Hi Mike,

Sorry about the delay in replying - I had to don my Sherlock Holmes hat and go searching for the old project :)

I've attached the main class that I created, but I must emphasize that it is more than a year since I last looked at this and it was actually built against G3D 8. I have learned a *lot* about G3D since then (and Qt for that matter), so it is probably not great, but you are welcome to take a look and see if it is of any help at all.

If you are keen to collaborate on this, then feel free to pm me and I can set up an SVN maybe? My Mac book Pro recently died though (Apple wanted £400 to replace the graphics card, despite admitting that it was a know manufacturing defect), so I am back in the world of Windows PC development full time for the foreseeable...

Cheers

E
qtwindow.zip

Mike Roberts

unread,
Apr 7, 2013, 8:56:53 AM4/7/13
to g3d-...@googlegroups.com
Hi friends,

I've made some more progress on my G3DWidget class for use in Qt applications.

At this point, my G3DWidget class implements the full G3D::OSWindow interface. My G3DWidget class integrates with the G3D event system, forwarding all keyboard and mouse events, drag and drop events, and window focus events. To test my implementation, I have been running the starter sample app and the pixelShader starter app concurrently in a single Qt application, with each sample app running in its own G3DWidget. As far as I can tell, all user input functionality in these embedded sample apps behaves identically to the functionality in their standalone counterparts. Screenshot attached.

My next steps will be to thoroughly document my code and share it on GitHub. Stay tuned  :)

Edward: Thanks for the zip file. I had a look at the code you sent. I ended up making good progress with a somewhat different design, so I just went with it. Anyway, let's chat more when I get the code online  :)

Cheers,
Mike
Screen Shot 2013-04-07 at 3.21.36 AM.png

Mike Roberts

unread,
Sep 3, 2013, 12:13:31 PM9/3/13
to g3d-...@googlegroups.com
Complete source code now online at https://github.com/mroberts3000/G3DWidget

Cheers,
Mike
screenshot.jpg
Reply all
Reply to author
Forward
0 new messages