Primitive¶
-
class
pyrender.
Primitive
(positions, normals=None, tangents=None, texcoord_0=None, texcoord_1=None, color_0=None, joints_0=None, weights_0=None, indices=None, material=None, mode=None, targets=None, poses=None)[source]¶ Bases:
object
A primitive object which can be rendered.
Parameters: - positions ((n, 3) float) – XYZ vertex positions.
- normals ((n, 3) float) – Normalized XYZ vertex normals.
- tangents ((n, 4) float) – XYZW vertex tangents where the w component is a sign value (either +1 or -1) indicating the handedness of the tangent basis.
- texcoord_0 ((n, 2) float) – The first set of UV texture coordinates.
- texcoord_1 ((n, 2) float) – The second set of UV texture coordinates.
- color_0 ((n, 4) float) – RGBA vertex colors.
- joints_0 ((n, 4) float) – Joint information.
- weights_0 ((n, 4) float) – Weight information for morphing.
- indices ((m, 3) int) – Face indices for triangle meshes or fans.
- material (
Material
) – The material to apply to this primitive when rendering. - mode (int) –
The type of primitives to render, one of the following:
0
: POINTS1
: LINES2
: LINE_LOOP3
: LINE_STRIP4
: TRIANGLES5
: TRIANGLES_STRIP6
: TRIANGLES_FAN
- targets ((k,) int) – Morph target indices.
- poses ((x,4,4), float) – Array of 4x4 transformation matrices for instancing this object.
Attributes Summary
bounds
buf_flags
The flags for the render buffer. centroid
The centroid of the primitive’s AABB. color_0
RGBA vertex colors. extents
The lengths of the axes of the primitive’s AABB. indices
Face indices for triangle meshes or fans. is_transparent
If True, the mesh is partially-transparent. joints_0
Joint information. material
The material for this primitive. mode
The type of primitive to render. normals
Normalized XYZ vertex normals. poses
Homogenous transforms for instancing this primitive. positions
XYZ vertex positions. scale
The length of the diagonal of the primitive’s AABB. tangents
XYZW vertex tangents. targets
Morph target indices. texcoord_0
The first set of UV texture coordinates. texcoord_1
The second set of UV texture coordinates. weights_0
Weight information for morphing. Methods Summary
delete
()Attributes Documentation
-
bounds
¶
Methods Documentation