Esempio n. 1
0
 def __init__(self):
     while True:
         self.x, self.y = np.random.uniform(-50.0, 50.0, 2)
         if not (self.x**2+self.y**2 < 10): break
     self.s = 3
     self.z = self.s
     self.GPU = es.toGPUShape(oh.readOBJ2(os.path.join('mod','tex','obstacle.obj'), os.path.join('mod','tex','obstacle.png')), GL_REPEAT, GL_NEAREST)
     self.transform = np.matmul(tr.translate(self.x,self.y,self.z), np.matmul(tr.rotationX(np.pi), tr.uniformScale(self.s)))
Esempio n. 2
0
 def __init__(self):
     self.GPU = es.toGPUShape(
         oh.readOBJ2(os.path.join('mod', 'tex', 'ground.obj'),
                     os.path.join('mod', 'tex', 'ground.png')), GL_REPEAT,
         GL_NEAREST)
     self.s = 100
     self.x, self.y, self.z = 0, 0, -self.s
     self.transform = np.matmul(tr.translate(self.x, self.y, self.z),
                                tr.uniformScale(self.s))
Esempio n. 3
0
 def __init__(self):
     self.x, self.y, self.z = -99, 0, 1  # position coordinates
     self.rho, self.phi = 0.01, 0  # direction vector
     self.bend = np.pi / 180 * 2 * 2 * 2  # how much to bend when turning
     self.turn = 0  # -1:right, 0:straight, 1:left
     self.time = 0
     self.s = 2  # scale
     self.GPU = es.toGPUShape(
         oh.readOBJ2(os.path.join('mod', 'tex', 'pokeball.obj'),
                     os.path.join('mod', 'tex', 'pokeball.png')), GL_REPEAT,
         GL_NEAREST)
     self.transform = np.matmul(
         np.matmul(tr.translate(*self.pos), tr.uniformScale(self.s / 2)),
         tr.rotationZ(self.phi))