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__
(camera=None, mesh=None, matrix=None)[source]¶ Create a node.
Keyword Arguments: - 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