I am using pyqtgraph 0.13.7 and PyQt5 5.15.9 and attempting to render text using GLTextItem in a 3D graphical interface, but the text is not displaying. Other 3D elements (such as axes, point clouds, etc.) render fine, but GLTextItem does not show up.
try:
self.view.addItem(gl.GLTextItem(pos=[length, 0, 0], text='X', color=(1, 0, 0, 1)))
self.view.addItem(gl.GLTextItem(pos=[0, length, 0], text='Y', color=(0, 1, 0, 1)))
self.view.addItem(gl.GLTextItem(pos=[0, 0, length], text='Z', color=(0, 0, 1, 1)))
Color should contain values between 0 and 255, not 0 and 1, so the following does work:
try:
self.view.addItem(gl.GLTextItem(pos=[length, 0, 0], text='X', color=(255, 0, 0, 255)))
self.view.addItem(gl.GLTextItem(pos=[0, length, 0], text='Y', color=(0, 255, 0, 255)))
self.view.addItem(gl.GLTextItem(pos=[0, 0, length], text='Z', color=(0, 0, 255, 255)))