Answers
Exercise A:
The code only differs from loading the teapot since it loads the granny model:
quat_granny = Object(“Granny”) quat_granny.add_component(Transform()) mat = Material(“shaders/texturedvert.vs”, “shaders/texturedfrag.vs”) quat_granny.add_component(LoadMesh(quat_granny.vao_ref, mat,GL_TRIANGLES, “models/granny.obj”, “images/granny.png”)) quat_granny.add_component(mat) quat_trans: Transform = quat_granny.get_component(Transform) quat_trans.update_position(pygame.Vector3(0, -100, -200)) In the fragment shader, remove the normal from the setup of frag_color (if you aren’t on Windows and haven’t commented out all the error-producing code), like this:
frag_color = vec4(1,1,1,1)