1
votes

Each file contains 3D points which I want to display. I want to see the display after each file is read. After file1, I want to see the points before adding more points from file2. Before adding more points from file3 I want to see the points from file 1 and 2.

How can I do that with QGLWidget functions?

I searched around and found updateGL() function. I thought of updating the draw function every time before new points are added but that would be inefficient. Is there any way to save the context (or what it is called)?

I am using the library libQGLViewer, which uses QGLViewer class, inherits from QGLWidget.

1

1 Answers

1
votes

You should call updateGL() everytime you want the viewport to be redrawn.

Even a basic modern GPU can render millions of points, so don't be worried about inefficiency - loading the point data from the files will be orders of magnitude slower than rendering them.