pyopengl如何渲染文字
我使用此功能渲染文本,但是第一个参数将报告错误。我不知道如何使用它
glutBitmapString(GLUT_BITMAP_TIMES_ROMAN_24, "text to render")
ctypes.ArgumentError: argument 2: <class 'TypeError'>: wrong type
I use this function to render text, but the first parameter will report an error. I don't know how to use it
glutBitmapString(GLUT_BITMAP_TIMES_ROMAN_24, "text to render")
ctypes.ArgumentError: argument 2: <class 'TypeError'>: wrong type
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(1)
glutbitmapcharacter
的第二个参数是代表一个字符的积分数字。您必须使用 -loop的来编写字符串,然后用
ord
:当使用
glutbitmapstring
时,该参数必须是二进制格式的字符串(b“ text to render” /代码>)。例如:
或
encdode> encdode
字符串最小示例:
The 2nd argument of
glutBitmapCharacter
is an integral number representing one character. You have to use afor
-loop to write a string and convert each character withord
:When using
glutBitmapString
, the argument must be a string in binary format (b"text to render"
). e.g.:or
encdode
the stringMinimal example: