Beispiel #1
0
 def __init__(self, parent, data):
     
     # Check data first
     if not isinstance(data, np.ndarray):
         raise ValueError('Textures can only be described using Numpy arrays.')
     
     # Instantiate as wobject (after making "sure" this texture can be ok)
     Wobject.__init__(self, parent)
     Colormapable.__init__(self)
     
     # create texture (remember, this is an abstract class)
     self._texture1 = None
     
     # create glsl program for this texture...
     self._shader = shaders.Shader()
     
     # scale and translation transforms
     self._trafo_scale = Transform_Scale()
     self._trafo_trans = Transform_Translate()
     self.transformations.append(self._trafo_trans)
     self.transformations.append(self._trafo_scale)        
Beispiel #2
0
 def __init__(self, parent, data):
     
     # Check data first
     if not isinstance(data, np.ndarray):
         raise ValueError('Textures can only be described using Numpy arrays.')
     
     # Instantiate as wobject (after making "sure" this texture can be ok)
     Wobject.__init__(self, parent)
     Colormapable.__init__(self)
     
     # create texture (remember, this is an abstract class)
     self._texture1 = None
     
     # create glsl program for this texture...
     self._shader = shaders.Shader()
     
     # scale and translation transforms
     self._trafo_scale = Transform_Scale()
     self._trafo_trans = Transform_Translate()
     self.transformations.append(self._trafo_trans)
     self.transformations.append(self._trafo_scale)        
Beispiel #3
0
 def __init__(self, parent, *args, **kwargs):
     Wobject.__init__(self, parent)
     
     # Init flat normals
     self._flatNormals = None
     
     # Create colormap and init texture
     Colormapable.__init__(self)
     self._texture = None
     
     # create glsl shaders for this wobject. For faces, edges and shape
     self._faceShader = shaders.Shader()
     self._edgeShader = shaders.Shader()
     self._shapeShader = shaders.Shader()
     self._InitShaders()
     self.useNativeShading = False
     
     # Material properties
     self._ambient = 0.7
     self._diffuse = 0.7
     self._specular = 0.3
     self._shininess = 50
     self._emission = 0.0
     
     # Reference colors
     self._faceColor = (1, 1, 1, 1)
     self._edgeColor = (0,0,0,1)
     
     # Shading
     self.faceShading = 'smooth'
     self.edgeShading = None
     
     # What faces to cull
     self._cullFaces = None # gl.GL_BACK (for surf(), None makes most sense)
     
     # Save data
     BaseMesh.__init__(self, *args, **kwargs)
     
     # Store value2, which are like 'values' but clim-corrected
     self._values2 = self._values
 def __init__(self, parent, *args, **kwargs):
     Wobject.__init__(self, parent)
     
     # Init flat normals
     self._flatNormals = None
     
     # Create colormap and init texture
     Colormapable.__init__(self)
     self._texture = None
     
     # create glsl shaders for this wobject. For faces, edges and shape
     self._faceShader = shaders.Shader()
     self._edgeShader = shaders.Shader()
     self._shapeShader = shaders.Shader()
     self._InitShaders()
     self.useNativeShading = False
     
     # Material properties
     self._ambient = 0.7
     self._diffuse = 0.7
     self._specular = 0.3
     self._shininess = 50
     self._emission = 0.0
     
     # Reference colors
     self._faceColor = (1, 1, 1, 1)
     self._edgeColor = (0,0,0,1)
     
     # Shading
     self.faceShading = 'smooth'
     self.edgeShading = None
     
     # What faces to cull
     self._cullFaces = None # gl.GL_BACK (for surf(), None makes most sense)
     
     # Save data
     BaseMesh.__init__(self, *args, **kwargs)
     
     # Store value2, which are like 'values' but clim-corrected
     self._values2 = self._values
Beispiel #5
0
 def __init__(self, parent, interval=100):
     Wobject.__init__(self, parent)
     MotionMixin.__init__(self)
     self.motionSplineType = 'nearest'
     self.MotionPlay(interval)
Beispiel #6
0
 def __init__(self, parent, interval=100):
     Wobject.__init__(self,parent)    
     MotionMixin.__init__(self)
     self.motionSplineType = 'nearest'
     self.MotionPlay(interval)