First, we need to modify LoadMesh. py to pass the vertex normal information that's being extracted from the OBJ file to the vertex shader. Modify the code like so:
class LoadMesh (Mesh3D) :
def_init_(self, vao_ref, material, draw_type,
model_filename, texture_file="",
back_face_cull=False) :
self. coordinates $=$
self.format_vertices (
self.vertices, self.triangles)
self.normals $=$
self.format_vertices (self.normals,
self.normal ind)
.
position = GraphicsData("vec3",
self.coordinates)
position.create_variable(material.program_id,
"position")
vertex_normals = GraphicsData("vec3",
self.normals)
vertex_normals.create_variable (
material.program_id,
"vertex_normal")
def format_vertices(self, coordinates, triangles):
.