API 参考:OpenGL 对象(opengl)¶
共 5 个类,按字母排序。每个类含中文说明、继承链、参数表与上手示例,API 文档由 autodoc 从 manim v0.21.0 源码自动生成;带完整中文精讲的类见 API 索引。
DotCloud¶
大量点组成的点云:PMobject 的高效批量渲染版,可视化散点/粒子。
继承关系¶
参数¶
|
ManimColor('#FFFF00'),ParsableManimColor |
|---|---|
|
2.0,float |
|
2.0,float |
|
10,float |
API 文档¶
- class manim.DotCloud(color: ManimColor | int | str | NDArray[int64] | tuple[int, int, int] | NDArray[float64] | tuple[float, float, float] | tuple[int, int, int, int] | tuple[float, float, float, float] = ManimColor('#FFFF00'), stroke_width: float = 2.0, radius: float = 2.0, density: float = 10, **kwargs: Any)¶
-
- init_points() Self¶
Initializes
pointsand therefore the shape.Gets called upon creation. This is an empty method that can be implemented by subclasses.
OpenGLPGroup¶
OpenGL 渲染下 PMobject 的分组容器(实验性)。
继承关系¶
API 文档¶
- class manim.OpenGLPGroup(*pmobs, **kwargs)¶
OpenGLPMPoint¶
OpenGL 渲染下的单点对象(实验性)。
继承关系¶
参数¶
|
array([0., 0., 0.]) |
|---|---|
|
4.0 |
API 文档¶
OpenGLPMobject¶
OpenGL 渲染管线的点集基类(实验性),与 cairo 版的 PMobject 平行。
参数¶
|
2.0,float |
|---|---|
|
ManimColor('#FFFF00'),ParsableManimColor |
|
0,int |
API 文档¶
- class manim.OpenGLPMobject(stroke_width: float = 2.0, color: ManimColor | int | str | NDArray[int64] | tuple[int, int, int] | NDArray[float64] | tuple[float, float, float] | tuple[int, int, int, int] | tuple[float, float, float, float] = ManimColor('#FFFF00'), render_primitive: int = 0, **kwargs)¶
基类:
OpenGLMobject- add_points(points: Point3DLike_Array, rgbas: FloatRGBALike_Array | None = None, color: ParsableManimColor | None = None, opacity: float | None = None) Self¶
Add points.
Points must be a Nx3 numpy array. Rgbas must be a Nx4 numpy array if it is not None.
- static get_mobject_type_class()¶
Return the base class of this mobject type.
- pointwise_become_partial(pmobject, a, b) Self¶
Set points in such a way as to become only part of mobject. Inputs 0 <= a < b <= 1 determine what portion of mobject to become.
Returns self to allow method chaining.
- sort_points(function=<function OpenGLPMobject.<lambda>>) Self¶
function is any map from R^3 to R
- thin_out(factor=5) Self¶
Removes all but every nth point for n = factor
TrueDot¶
严格按点渲染的 Dot:无最小尺寸限制,配合 DotCloud 做精确散点。
继承关系¶
参数¶
|
array([0., 0., 0.]),Point3DLike |
|---|---|
|
2.0,float |