textureFlatPipeline = es.SimpleTextureFlatShaderProgram() textureGouraudPipeline = es.SimpleTextureGouraudShaderProgram() texturePhongPipeline = es.SimpleTexturePhongShaderProgram() # This shader program does not consider lighting colorPipeline = es.SimpleModelViewProjectionShaderProgram() # Setting up the clear screen color glClearColor(0.15, 0.15, 0.15, 1.0) # As we work in 3D, we need to check which part is in front, # and which one is at the back glEnable(GL_DEPTH_TEST) # Creating shapes on GPU memory gpuAxis = es.to_gpu_shape(shapes.create_axis(4)) gpuTextureCube = es.to_gpu_shape(shapes.create_texture_normals_cube('example_data/bricks.jpg'), GL_REPEAT, GL_LINEAR) t0 = glfw.get_time() camera_theta = np.pi / 4 # Create light obj_light = Light(position=[5, 5, 5], color=[1, 1, 1]) # Mainloop while not glfw.window_should_close(window): # Using GLFW to check for input events glfw.poll_events()
# Assembling the shader program pipeline = es.SimpleModelViewProjectionShaderProgram() # Telling OpenGL to use our shader program glUseProgram(pipeline.shaderProgram) # Setting up the clear screen color glClearColor(0.15, 0.15, 0.15, 1.0) # As we work in 3D, we need to check which part is in front, # and which one is at the back glEnable(GL_DEPTH_TEST) # Creating shapes on GPU memory gpuAxis = es.to_gpu_shape(bs.create_axis(7)) gpuRedCube = es.to_gpu_shape(bs.create_color_cube(1, 0, 0)) gpuGreenCube = es.to_gpu_shape(bs.create_color_cube(0, 1, 0)) gpuBlueCube = es.to_gpu_shape(bs.create_color_cube(0, 0, 1)) gpuYellowCube = es.to_gpu_shape(bs.create_color_cube(1, 1, 0)) gpuCyanCube = es.to_gpu_shape(bs.create_color_cube(0, 1, 1)) gpuPurpleCube = es.to_gpu_shape(bs.create_color_cube(1, 0, 1)) gpuRainbowCube = es.to_gpu_shape(bs.create_rainbow_cube()) t0 = glfw.get_time() camera_theta = np.pi / 4 # Mainloop while not glfw.window_should_close(window): # Using GLFW to check for input events