Exemple #1
0
 def __init__(self, context_identifier: str):
     """Create a new TriMesh.
     The object can be created from another thread so OpenGL
     variables cannot be set from here"""
     self.context_identifier = context_identifier  # a string identifier unique to the context
     self._vao = None  # vertex array object
     self._vbo = None  # vertex buffer object
     self._shader = None  # the shader program
     self._trm_mat_loc = None  # the reference within the shader program of the transformation matrix
     self.verts = new_empty_verts()  # the vertices to draw
     self.draw_start = 0
     self.draw_count = 0  # the number of vertices to draw
Exemple #2
0
    def _set_verts(self, chunk_verts: List[numpy.ndarray], chunk_verts_translucent: List[numpy.ndarray]):
        if chunk_verts:
            self.verts = numpy.concatenate(chunk_verts, 0)
            self.verts_translucent = self.verts.size
        else:
            self.verts = new_empty_verts()

        if chunk_verts_translucent:
            chunk_verts_translucent.insert(0, self.verts)
            self.verts = numpy.concatenate(chunk_verts_translucent, 0)

        self.draw_count = int(self.verts.size // self._vert_len)
Exemple #3
0
 def _create_lod1(self, blocks: numpy.ndarray, larger_blocks: numpy.ndarray,
                  unique_blocks: numpy.ndarray):
     # TODO
     self.verts: numpy.ndarray = new_empty_verts()
Exemple #4
0
 def _create_error_geometry(self):
     # TODO
     self.verts: numpy.ndarray = new_empty_verts()
Exemple #5
0
 def _create_empty_geometry(self):
     self.verts: numpy.ndarray = new_empty_verts()