GillesDebunne / libQGLViewer

libQGLViewer is an open source C++ library based on Qt that eases the creation of OpenGL 3D viewers.
Other
241 stars 94 forks source link

drawing selectable points #43

Closed CDitzel closed 6 years ago

CDitzel commented 6 years ago

In the documentation is says

If your selected objects are points, do not use \c glBegin(GL_POINTS); and \c glVertex3fv() in the above \c draw() method (not compatible with raster mode): use \c glRasterPos3fv() instead

But I am lost on how to do that exactly. So instead of of writing in my draw method

glBegin(GL_POINTS); glColor3f(1.0, 0.0, 0.0); glVertex3ff(1.f, 1.f, 1.f); glEnd();

what do I have to put to display a point which is selectable?

GillesDebunne commented 6 years ago

I'm no longer an expert in that field, but I guess you can simply replace your entire code with glRasterPos3f(1.f, 1.f, 1.f) (color is meaningless here).

If that does not work, check the forums, this is a pretty standard OpenGL question I think.