Class representing a sub-mesh containing local vertices and triangles. More...
Functions | |
np.array[float] | vertices (self) |
NumPy array of vertices. More... | |
np.array[int] | triangles (self) |
NumPy array of triangles/faces. More... | |
np.array[float] | normals (self) |
NumPy array of normals. More... | |
np.array[int] | colors (self) |
NumPy array of colors. More... | |
np.array[float] | uv (self) |
UVs defines the 2D projection of each vertices onto the texture. More... | |
int | timestamp (self) |
Timestamp of the latest update. | |
np.array[float] | barycenter (self) |
3D centroid of the chunk. | |
bool | has_been_updated (self) |
Whether the chunk has been updated by an inner process. | |
None | clear (self) |
Clears all data. | |
Class representing a sub-mesh containing local vertices and triangles.
Vertices and normals have the same size and are linked by id stored in triangles.
np.array[float] vertices | ( | self | ) |
NumPy array of vertices.
Vertices are defined by a 3D point [x, y, z]
.
np.array[int] triangles | ( | self | ) |
NumPy array of triangles/faces.
Triangle defined as a set of three vertices indexes [v1, v2, v3]
.
np.array[float] normals | ( | self | ) |
NumPy array of normals.
Normals are defined by three components [nx, ny, nz]
.
np.array[int] colors | ( | self | ) |
NumPy array of colors.
Colors are defined by three components [r, g, b]
.
np.array[float] uv | ( | self | ) |
UVs defines the 2D projection of each vertices onto the texture.
Values are normalized [0, 1] and start from the bottom left corner of the texture (as requested by OpenGL).
In order to display a textured mesh you need to bind the texture and then draw each triangle by picking its uv values.