def __init__(self, background): super(Renderer, self).__init__(background) glEnable(GL_DEPTH_TEST) glEnable(GL_MULTISAMPLE) glEnable(GL_BLEND) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) self.visible = [False for _ in range(len(geodesic_grid.sections))] self.common_model_transform = opengl.Transform() self.last_render_quaternion = quaternion.Quaternion( self.common_model_transform.quaternion) vertices = [(p.x, p.y, p.z) for t in geodesic_grid.sections for p in t] self.sphere = opengl.Object(vertices, enable_alpha=True) self.sphere.local.scale(0.46) self.sphere.model = self.common_model_transform self.base_color = Vector3(0.08, 0.68, 0.706667) self.vehicle = None path = os.path.join(magical.datapath, 'arrow.obj') obj = wv.ObjParser(filename=path).parse() self.mag = opengl.WavefrontObject(obj) self.mag.local.scale(.88)
def set_vehicle_wavefront(self, vehicle): self.vehicle = opengl.WavefrontObject(vehicle) # FIXME: this class shouldn't need to be aware of the proper scaling self.vehicle.local.scale(4.4)
def set_vehicle_wavefront(self, vehicle): self.vehicle = opengl.WavefrontObject(vehicle) # FIXME: this class shouldn't need to be aware of the proper scaling self.vehicle.local.scale(3.5) self.vehicle.model = self.common_model_transform