Panda3DGeometryRenderer¶
- class Panda3DGeometryRenderer(self, renderType: visp._visp.ar.Panda3DGeometryRenderer.RenderType)¶
Bases:
Panda3DBaseRenderer
Renderer that outputs object geometric information.
This information may contain, depending on requested render type:
Normals in the world frame or in the camera frame.
Depth information
Methods
Overloaded function.
Inherited Methods
Set the behaviour when a Panda3D assertion fails.
Get the name of the renderer.
Load a 3D object.
Overloaded function.
Retrieve the camera's pose, in the world frame.
Add a node to the scene.
Set the camera's pose.
Initialize the whole Panda3D framework.
Overloaded function.
Get the rendering order of this renderer.
set whether vertical sync is enabled.
Compute the near and far planes for the camera at the current pose, given a certain node/part of the graph.
Get the scene root.
Returns true if this renderer process 3D data and its scene root can be interacted with.
Overloaded function.
Set new rendering parameters.
Operators
__doc__
__module__
Attributes
CAMERA_NORMALS
OBJECT_NORMALS
__annotations__
- class RenderType(self, value: int)¶
Bases:
pybind11_object
Values:
OBJECT_NORMALS
CAMERA_NORMALS: Surface normals in the object frame.
- __init__(self, renderType: visp._visp.ar.Panda3DGeometryRenderer.RenderType)¶
- addNodeToScene(self, object: NodePath) None ¶
Add a node to the scene. Its pose is set as the identity matrix.
- Parameters:
- object: NodePath¶
- computeNearAndFarPlanesFromNode(self, name: str, near: float, far: float, fast: bool) tuple[float, float] ¶
Compute the near and far planes for the camera at the current pose, given a certain node/part of the graph.
The near clipping value will be set to the distance to the closest point of the object. The far clipping value will be set to the distance to farthest vertex of the object.
Warning
Depending on geometry complexity, this may be an expensive operation.
Warning
if the object lies partly behind the camera, the near plane value will be zero. If it fully behind, the far plane will also be zero. If these near/far values are used to update the rendering parameters of the camera, this may result in an invalid projection matrix.
- Parameters:
- name: str¶
name of the node that should be used to compute near and far values.
- near: float¶
resulting near clipping plane distance
- far: float¶
resulting far clipping plane distance
- fast: bool¶
Whether to use the axis align bounding box to compute the clipping planes. This is faster than reprojecting the full geometry in the camera frame
- Returns:
A tuple containing:
near: resulting near clipping plane distance
far: resulting far clipping plane distance
- getCameraPose(self) visp._visp.core.HomogeneousMatrix ¶
Retrieve the camera’s pose, in the world frame. The pose is specified using the ViSP convention (Y-down right handed).
- getNodePose(*args, **kwargs)¶
Overloaded function.
getNodePose(self: visp._visp.ar.Panda3DBaseRenderer, name: str) -> visp._visp.core.HomogeneousMatrix
Get the pose of a Panda node, in world frame in the ViSP convention (Y-down right handed).
- Parameters:
- name
Node path to search for.
- Returns:
wTo, the pose of the object in world frame
getNodePose(self: visp._visp.ar.Panda3DBaseRenderer, object: NodePath) -> visp._visp.core.HomogeneousMatrix
Get the pose of a Panda node, in world frame in the ViSP convention (Y-down right handed). This version of the method directly uses the Panda Nodepath.
- getRender(*args, **kwargs)¶
Overloaded function.
getRender(self: visp._visp.ar.Panda3DGeometryRenderer, colorData: visp._visp.core.ImageRGBf, depth: visp._visp.core.ImageFloat) -> None
Get render results into ViSP readable structures.
- Parameters:
- colorData
Depending on the vpRenderType, normals in the world or camera frame may be stored in this image.
- depth
Image used to store depth
getRender(self: visp._visp.ar.Panda3DGeometryRenderer, normals: visp._visp.core.ImageRGBf, depth: visp._visp.core.ImageFloat, bb: visp._visp.core.Rect, h: int, w: int) -> None
getRender(self: visp._visp.ar.Panda3DGeometryRenderer, colorData: visp._visp.core.ImageRGBf) -> None
Get render results into ViSP readable structures. This version only retrieves the normal data.
- Parameters:
- colorData
Depending on the vpRenderType, normals in the world or camera frame may be stored in this image.
getRender(self: visp._visp.ar.Panda3DGeometryRenderer, depth: visp._visp.core.ImageFloat) -> None
Get render results into ViSP readable structures. This version only retrieves the depth data.
- Parameters:
- depth
Depending on the vpRenderType, rendered depth may be stored in this image.
- getRenderOrder(self) int ¶
Get the rendering order of this renderer. If a renderer A has a lower order value than B, it will be rendered before B. This is useful, if for instance, B is a postprocessing filter that depends on the result of B.
- Returns:
int
- getRenderRoot(self) NodePath ¶
Get the scene root.
- initFramework(self) None ¶
Initialize the whole Panda3D framework. Create a new PandaFramework object and a new window.
Will also perform the renderer setup (scene, camera and render targets)
- initFromParent(*args, **kwargs)¶
Overloaded function.
initFromParent(self: visp._visp.ar.Panda3DBaseRenderer, framework: PandaFramework, window: PointerTo<WindowFramework>) -> None
initFromParent(self: visp._visp.ar.Panda3DBaseRenderer, renderer: visp._visp.ar.Panda3DBaseRenderer) -> None
- isRendering3DScene(self) bool ¶
Returns true if this renderer process 3D data and its scene root can be interacted with.
This value could be false, if for instance it is redefined in a subclass that performs postprocessing on a texture.
- loadObject(self, nodeName: str, modelPath: str) NodePath ¶
Load a 3D object. To load an .obj file, Panda3D must be compiled with assimp support.
Once loaded, the object will not be visible, it should be added to the scene.
- setAbortOnPandaError(self, abort: bool) None ¶
Set the behaviour when a Panda3D assertion fails. If abort is true, the program will stop. Otherwise, an error will be displayed in the console.
- setCameraPose(self, wTc: visp._visp.core.HomogeneousMatrix) None ¶
Set the camera’s pose. The pose is specified using the ViSP convention (Y-down right handed).
- Parameters:
- wTc: visp._visp.core.HomogeneousMatrix¶
the new pose of the camera, in world frame
- setNodePose(*args, **kwargs)¶
Overloaded function.
setNodePose(self: visp._visp.ar.Panda3DBaseRenderer, name: str, wTo: visp._visp.core.HomogeneousMatrix) -> None
Set the pose of a node. This node can be any Panda object (light, mesh, camera). The pose is specified using the ViSP convention (Y-down right handed).
- Parameters:
- name
Node path to search for, from the render root. This is the object that will be modified See https://docs.panda3d.org/1.10/python/programming/scene-graph/searching-scene-graph
- wTo
Pose of the object in the world frame
setNodePose(self: visp._visp.ar.Panda3DBaseRenderer, object: NodePath, wTo: visp._visp.core.HomogeneousMatrix) -> None
Set the pose of a node. The pose is specified using the ViSP convention (Y-down right handed). This node can be any Panda object (light, mesh, camera).
- Parameters:
- object
The object for which to set the pose
- wTo
Pose of the object in the world frame
- setRenderParameters(self, params: visp._visp.ar.Panda3DRenderParameters) None ¶
Set new rendering parameters. If the scene has already been initialized, the renderer camera is updated.
- Parameters:
- params: visp._visp.ar.Panda3DRenderParameters¶
the new rendering parameters
- setVerticalSyncEnabled(self, useVsync: bool) None ¶
set whether vertical sync is enabled. When vertical sync is enabled, render speed will be limited by the display’s refresh rate
- static vispPointToPanda(point: visp._visp.core.ColVector) visp._visp.core.ColVector ¶
- static vispVectorToPanda(vec: visp._visp.core.ColVector) visp._visp.core.ColVector ¶