[pyassimp] Handle diffuse/ambient values stored as vec3 instead of vec4

pull/49/head
Séverin Lemaignan 2013-03-30 21:39:51 +01:00
parent 08e078e20d
commit 024bd4c470
1 changed files with 7 additions and 2 deletions

View File

@ -291,8 +291,13 @@ class PyAssimp3DViewer:
stride = 24 # 6 * 4 bytes stride = 24 # 6 * 4 bytes
glUniform4f( shader.Material_diffuse, *mesh.material.properties["diffuse"] ) diffuse = mesh.material.properties["diffuse"]
glUniform4f( shader.Material_ambient, *mesh.material.properties["ambient"] ) if len(diffuse) == 3: diffuse.append(1.0)
ambient = mesh.material.properties["ambient"]
if len(ambient) == 3: ambient.append(1.0)
glUniform4f( shader.Material_diffuse, *diffuse )
glUniform4f( shader.Material_ambient, *ambient )
vbo = mesh.gl["vbo"] vbo = mesh.gl["vbo"]
vbo.bind() vbo.bind()