QSGGeometry how to draw disk points and not squared ones
-
@EmilieG said in QSGGeometry how to draw disk points and not squared ones:
QSGGeometry
Can you draw a point on the end of the line?
https://doc.qt.io/qt-5/qsggeometry.html#DrawingMode-enumI don't have a setup to test this at the moment.
Edit:
Also, I don't know if a point will be smooth. -
I'm using
QSGGeometry::DrawPoints
to draw points instead of lines and it's working, but the points are squares not round.@EmilieG
I see an old post in this forum https://forum.qt.io/topic/13099/solved-recommended-approaches-to-plotting-points-in-3d states:Starting to get things working now, using QGLWidget and drawing circular "points" using glPointSize() and glEnable(GL_POINT_SMOOTH) functions. I found "this example":http://www.civilnet.cn/book/embedded/gui/qt4/ch08lev1sec5.html a helpful starting point.
That implies the guy was able to use
gl_enable(GL_POINT_SMOOTH)
from Qt, though I don't know anything aboutQGLWidget
orQSGGeometry
or how they compare. Unfortunately the linked book does not exist ... :(Ah, another post here, https://forum.qt.io/topic/30516/solved-how-can-i-draw-xor-lines-in-a-qgraphicsscene, shows
glEnable(GL_POINT_SMOOTH);
being used?I'd better stop, as I'm afraid I have no idea whether this applies for your
QSGGeometry
.... -
If you need points at each location you could create an QSGNode that is a texture. I did this over the weekend. There is an example in there of using QPainter to render to texture and then turn this into a node that is for textures.
https://github.com/Demolishun/MeetupGameHackathon1