Node
- moderngl_window.scene.Node[source]
A generic scene node containing a mesh or camera and/or a container for other nodes. Nodes and their children represents the scene tree.
Methods
- Node.__init__(name=None, camera=None, mesh=None, matrix=None)[source]
Create a node.
- Keyword Arguments:
name – Name of the node
camera – Camera to store in the node
mesh – Mesh to store in the node
matrix – The node’s matrix
- Node.add_child(node)[source]
Add a child to this node
- Parameters:
node (Node) – Node to add as a child
- Node.draw(projection_matrix=None, camera_matrix=None, time=0)[source]
Draw node and children.
- Keyword Arguments:
projection_matrix (bytes) – projection matrix
camera_matrix (bytes) – camera_matrix
time (float) – The current time
- Node.draw_bbox(projection_matrix, camera_matrix, program, vao)[source]
Draw bounding box around the node and children.
- Keyword Arguments:
projection_matrix (bytes) – projection matrix
camera_matrix (bytes) – camera_matrix
program (moderngl.Program) – The program to render the bbox
vao – The vertex array representing the bounding box
- Node.draw_wireframe(projection_matrix, camera_matrix, program)[source]
Render the node as wireframe.
- Keyword Arguments:
projection_matrix (bytes) – projection matrix
camera_matrix (bytes) – camera_matrix
program (moderngl.Program) – The program to render wireframe
Attributes
- Node.name
Get or set the node name
- Type:
str
- Node.matrix
Note matrix (local)
- Type:
numpy.ndarray
- Node.matrix_global
The global node matrix containing transformations from parent nodes
- Type:
numpy.ndarray
- Node.children
List of children
- Type:
list