PDA

View Full Version : 3D reccomendations



enricong
19th December 2014, 03:55
I am using QT 4 and I need to add a display for a custom CAD format. It consists with a list of 3D points (x,y,z), then a definition for each 3D object using the points (Trapezoid/Triangle, elliptic plate, elliptic cylinder, elliptic cone, Ellipsoid, Circular paraboloid, Elliptic hyperboloid, and Circular torus).

There are probably 300000 3d objects I need to draw, mostly trapizoids/triangles but I need to support all of the above types.

The user will need to be able to use the mouse/keyboard and rotate, zoom, pan. Other than that no animation. No fancy backgrounds/texturing. Click on an object to get the object ID and do something with it. I may also want to highlight specific objects or draw some lines pointing to objects. That is about it.

I did some work using Coin3D maybe 10-15 years ago.

I think things like rotating using the mouse, zooming using the wheel, panning with the keyboard+mouse, clicking or drawing a box to select objects are fairly standard so I'd hope there are some convenience GUI functions available so I dont have to reinvent the wheel.

I'm looking for some suggestions on which 3D engine I should use. (http://qt-project.org/wiki/Using_3D_engines_with_Qt)

I'm mainly looking for convenience to implement and performance given the size I indicated above

d_stranz
19th December 2014, 04:04
You might take a look at VTK (http://www.vtk.org/) from KitWare (http://www.kitware.com/). There is an interface to QWidget which lets you embed a visualization into a Qt app.

d_stranz
19th December 2014, 16:54
And it looks like Qt3D 2.0 (http://www.kdab.com/overview-qt3d-2-0-part-1/) is finally getting some "ownership" and support. I saw a presentation on this at Qt Dev Days last month, and it looks pretty sophisticated. I don't know how much high-level support there will be for things like CAD, modeling, or scientific visualization. I will be keeping an eye on it.

enricong
19th December 2014, 17:04
Thanks, I'll take a look.

Its hard to know which one is easiest to start with since I am doing something fairly simple.

d_stranz
19th December 2014, 17:51
That's the problem with all of the 3D kits mentioned on the page you linked. They are all so complex and comprehensive that the learning curve is long and steep. I've been looking for years and have been too overwhelmed to be able to invest the time to learn any of them.

pixaeiro
19th December 2014, 17:57
Hello enricong,

Sometime ago I developed a 3D painting application, very similar to what you need:
http://www.mankua.com/Stripes/Stripes.php
http://vimeo.com/22307556

I have tried these two engines:
Ogre3D: http://www.ogre3d.org/
Geometric Tools - WildMagic: http://www.geometrictools.com/

But at the end I decided not to use anything but OpenGL. The reason is that most engines are designed for games, and they don't support some other features. In my case it was rendering of wireframe meshes.

Qt has very good QGLWidget. You just need to define your view (what the mouse controls with pan, orbit and zoom actions) and start drawing your 3D primitives.

You don't know OpenGL? No problem... I didn't know any OpenGL when I started working on that software and I followed the first 4 or 5 NeHe tutorials and I was good to go:
http://nehe.gamedev.net/tutorial/lessons_01__05/22004/

You can copy paste NeHe's code to the QGLWindow and you'll need very little code to make it work.

Good Luck! If you need help I can probably send you some of the code from that software!

enricong
19th December 2014, 19:32
Yeah, that is the issue. I am drawing simple objects (Trapezoid/Triangle, elliptic plate, elliptic cylinder, elliptic cone, Ellipsoid, Circular paraboloid, Elliptic hyperboloid, and Circular torus) by specifying points. I hope there would be a GUI library that could take care of the interface (mouse rotation, etc). I don't even really have any animation.

I did look at QT3D or QTGL (not sure exactly, is QT3D a separate piece? it points to QTGLxxxx classes). I can do the triangles, plate, cylinder, cone. And do the ellipse with scaling. However, I didn't see anything that would allow me to draw a paraboloid, hyperboloid or torus.

I am basically rendering a mesh with a few surface shapes thrown in.

pixaeiro
20th December 2014, 00:00
I don't know if there is any kind of library that supports the objects you need to draw. One of the most complete in number of features is WildMagic. It is an educational tool, so it supports a lot of things that are not really needed in the gaming world.

As for mouse manipulation, that bit is not so hard. I once created an open source 3d editor and I implemented all the mouse manipulation tools. Here are they on a QGLWidget:

http://sourceforge.net/p/sceneengine/code/HEAD/tree/trunk/Apps/CrackArt/Main/QGLViewport.cpp
http://sourceforge.net/p/sceneengine/code/HEAD/tree/trunk/Apps/CrackArt/Main/MouseView.cpp

Good luck!

enricong
20th December 2014, 00:57
I spent the afternoon looking through QT3D more carefully. I might be able to do without those missing items or create a function to build them with triangles or something.

I did see that I can do the rotating, zooming with QGLView.

I'm not too clear on how to be able to use the mouse to select a specific object and trigger a signal to tell me which object I just selected so I can highlight it and do other things in a slot. I see a QGLPickNode for "picking" but its not clear to me what this really does and it'll do what I want.