Ejemplo n.º 1
0
 def __init__(self, pos):
     self._pos = AnimatedVector3(pos)
     self._orientation = AnimatedQuaternion()
     #self.viewangle = -7*math.pi/16
     #self.viewangle = -15*math.pi/32
     self.viewangle = -127 * math.pi / 256
     self._orientation.set(euclid.Quaternion().rotate_axis(
         self.viewangle, euclid.Vector3(1, 0, 0)))
     self._orientation.set_transition(dt=0.5, method="sine")
     self.view_switched = False
     self.vis_distance = 6.5
     self.x_limit = (-20, 20)
     self.y_limit = (15, 40)
     self.z_limit = (-20, 20)
Ejemplo n.º 2
0
 def __init__(self, gamecard, front, back):
     self.gamecard = gamecard
     self.front = front
     self.back = back
     self.hidden = False
     self.width, self.height = self.front.width, self.front.height
     self.size = anim.constant(1.0)
     self._pos = AnimatedVector3(0, 0, 0)
     self.pos_transition = "ease_out_circ"
     self._orientation = AnimatedQuaternion()
     self.visible = anim.constant(1.0)
     self.alpha = anim.constant(1.0)
     if not Card.cardlist:
         Card.cardlist = self.build_displaylist(self.width, self.height)
     #self.renderwidth, self.renderheight = 736, 1050
     #self.renderwidth, self.renderheight = 368, 525
     #self.renderwidth, self.renderheight = 397, 553
     if not Card.fbo: Card.build_fbo()
     if not Card.renderlist:
         Card.renderlist = self.build_renderlist(self.renderwidth,
                                                 self.renderheight)
Ejemplo n.º 3
0
 def __init__(self, ctype, color=None):
     self.ctype = ctype
     if not color:
         color = [0, 0, 0]
         temp = hash(ctype) % 2**24
         color[0] = temp / 2**16
         temp = temp % 2**16
         color[1] = temp / 2**8
         color[2] = temp % 2**8
         self.color = (color[0] / 255.0, color[1] / 255.0, color[2] / 255.0)
     else:
         self.color = color
     self.size = anim.constant(1)
     self._pos = AnimatedVector3(0, 0, 0)
     self._orientation = AnimatedQuaternion()
     self.orientation = euclid.Quaternion.new_rotate_axis(
         pi, euclid.Vector3(0, 0, 1))
     self.visible = anim.constant(1.0)
     self.alpha = 0.9  #0.7 #anim.constant(1.0)
     cls = self.__class__
     if not cls.piece_list: self.build_piece_list(cls)