# Setting up the clear screen color glClearColor(0.85, 0.85, 0.85, 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) # Generate tree scene graph node tree_node = get_tree_model_sg(tree_obj, leaves_obj, tree_color=(0.59,0.29,0.00), leaves_color=(0,0.7,0)) # Save tree with leaves tree_obj.join(leaves_obj) tree_obj.to_file(args.filename) gpuAxis = es.toGPUShape(bs.createAxis(7)) # Using the same view and projection matrices in the whole application projection = tr.perspective(45, float(width)/float(height), 0.1, 100) camera_theta = 0.0 camera_phi = np.pi/4 camera_r = 3 ltime = 0 while not glfw.window_should_close(window): # Using GLFW to check for input events glfw.poll_events() time = glfw.get_time() dt = time-ltime ltime = time
def __init__(self): self.model = es.toGPUShape(bs.createAxis(1)) self.show = True