FrontPage/Python/OpenCV
FrontPage/Python
OpenGL for Python †
文字列を表示する †
def drawBitmapText(text, x, y, z, color):
#~ GLUT_BITMAP_8_BY_13
#~ GLUT_BITMAP_9_BY_15
#~ GLUT_BITMAP_TIMES_ROMAN_10
#~ GLUT_BITMAP_TIMES_ROMAN_24
#~ GLUT_BITMAP_HELVETICA_10
#~ GLUT_BITMAP_HELVETICA_12
#~ GLUT_BITMAP_HELVETICA_18
glDisable(GL_LIGHTING)
glColor4f(color[0], color[1], color[2], color[3])
glRasterPos3f(x, y, z)
for c in text:
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_10, ord(c))
# end for
glEnable(GL_LIGHTING)
# end def drawBitmapText