【发布时间】:2017-12-11 16:11:58
【问题描述】:
我向您展示了使用 Kivy OpenGL 的代码中的函数。这部分代码是我的问题的根源。出现问题后,我使用参数fmt 测试了下一个变体:
-
vertex_format=[('v_pos', 3, 'float')]->
例外:expected byte, found str -
vertex_format=[(b'v_pos', 3, 'float')]->
屏幕上没有场景图片 - 我不使用参数
fmt->
场景图片的几何形状不正确
我必须如何更正代码?请帮帮我!
def setup_scene(self):
Color(1, 0, 1, 1)
PushMatrix()
self.rot = Rotate(1, 0, 1, 0)
UpdateNormalMatrix()
vertex_format = [('v_pos', 3, 'float')]
self.mesh = Mesh(
vertices=[1, 1, 1, 2, 2, 2, 3, 3, 3],
indices=self.indices,
fmt=vertex_format,
mode='lines'
)
PopMatrix()
【问题讨论】: