def __init__(self): self._texture = [None,None,None] # three textures supported self._diffuse_color = floatArray([0.8,0.8,0.8]) self._ambient_color = floatArray([0.2,0.2,0.2]) self._specular_color = floatArray([1.0,1.0,1.0]) self._specular_exp = 2.0 self._alpha = 1.0 self._shader = None
def parseColor(txt): orig_txt = txt rgb = [0, 0, 0] for i in xrange(3): try: rgb[i], txt = parseFloat(txt) except ValueError: raise ValueError('Invalid color: %s' % orig_txt) return (floatArray(rgb), txt)
def __init__(self): self._model_m_changed = True self._camera = None self._default_camera = OrthoCamera() self.setCamera(None) self._model_m = T.identity_matrix() self._model_m_stack = [T.identity_matrix()] self._light_position = floatArray([1000.0, 1000.0, 1000.0]) # these are computed and cached: self._normal_m = None self._modelview_m = None self._light_m = None self._view_m = self._projection_m = None