Rendering and Picking

Feel free to ask any question here
Post Reply
manatttta
Posts: 12
Joined: Wed Oct 08, 2014 10:38 am

Rendering and Picking

Post by manatttta »

Hello,

first of all congratulations for the CloudCompare software. I think it really outperforms Meshlab in a series of ways, has a much more clean code, and has great ideas implemented. Altough, I notice it can be somewhat slow in rendering large point clouds.

I have some simple questions that I've been trying to figure out, but after digging in so much code I just gave up, as this shall be pretty straight forward to answer:

- How is a ply file rendered? Does it use OpenGL lists (glGenList()), single points/vertices (glVertex()), or array lists?

- The reason I want to ask this is because I don't understand how CC can perform picking the old fashion way. Does it generate a name (glPushName() etc) for each vertex?

- Furthermore, how does the "Segment" function operates? Does it rely on picking? How?


Thanks very much in advance.
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Rendering and Picking

Post by daniel »

We don't use OpenGL lists in CC as they are stored on the GPU memory and you would quickly overflow it with big point clouds or meshes.

But we use array lists whenever possible. However we have to slice the data (once again for memory issues but also for other reasons) and send them by chunk instead of the whole data at once. We also have to deal with the cases when the mesh is displayed with an active scalar field and some vertices are hidden, or when the segmentation tool is enabled. We also have to deal with the fact that normals are compressed (once again, in order to save some memory). And displaying the dynamic false colors for scalar fields relies on a specific shader (if supported) or on more standard code (for old graphic cards), etc. Each time you have to maintain the various ways to do it so that it works on all graphic cards. And all this explains why the display code may be quite complicated.

And for point clouds only, we also use VBOs (Vertex Buffer Objects) and we now have a LOD (Level Of Detail) structure which makes the code even more complicated :D

And regarding picking: yes before the 2.6 version it was done with glPushName (one per point). It was not that bad but some drivers (especially Intel's) were handling this very badly. This is why we switched to a more generic approach. It's still quite 'brute-force' but at least it doesn't depend anymore on the driver (only on the CPU speed :D).

And last point: the 'Segment' tool simply projects each point/vertex in the 2D screen space and test the inclusion inside the polygon defined by the user.
Daniel, CloudCompare admin
Post Reply