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

__init__

getRender

Overloaded function.

Inherited Methods

setAbortOnPandaError

Set the behaviour when a Panda3D assertion fails.

beforeFrameRendered

setName

setRenderOrder

getName

Get the name of the renderer.

enableSharedDepthBuffer

loadObject

Load a 3D object.

getNodePose

Overloaded function.

getCameraPose

Retrieve the camera's pose, in the world frame.

addNodeToScene

Add a node to the scene.

setCameraPose

Set the camera's pose.

initFramework

Initialize the whole Panda3D framework.

vispVectorToPanda

printStructure

initFromParent

Overloaded function.

afterFrameRendered

getRenderOrder

Get the rendering order of this renderer.

setVerticalSyncEnabled

set whether vertical sync is enabled.

vispPointToPanda

computeNearAndFarPlanesFromNode

Compute the near and far planes for the camera at the current pose, given a certain node/part of the graph.

enableDebugLog

getRenderRoot

Get the scene root.

isRendering3DScene

Returns true if this renderer process 3D data and its scene root can be interacted with.

setNodePose

Overloaded function.

renderFrame

setRenderParameters

Set new rendering parameters.

Operators

__doc__

__init__

__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.

__and__(self, other: object) object
__eq__(self, other: object) bool
__ge__(self, other: object) bool
__getstate__(self) int
__gt__(self, other: object) bool
__hash__(self) int
__index__(self) int
__init__(self, value: int)
__int__(self) int
__invert__(self) object
__le__(self, other: object) bool
__lt__(self, other: object) bool
__ne__(self, other: object) bool
__or__(self, other: object) object
__rand__(self, other: object) object
__ror__(self, other: object) object
__rxor__(self, other: object) object
__setstate__(self, state: int) None
__xor__(self, other: object) object
property name : str
__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

afterFrameRendered(self) None
beforeFrameRendered(self) None
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

enableDebugLog(self) None
enableSharedDepthBuffer(self, sourceBuffer: visp._visp.ar.Panda3DBaseRenderer) None
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).

getName(self) str

Get the name of the renderer.

Returns:

const std::string&

getNodePose(*args, **kwargs)

Overloaded function.

  1. 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

  1. 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.

  1. 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

  1. 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

  2. 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.

  1. 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.

  1. initFromParent(self: visp._visp.ar.Panda3DBaseRenderer, framework: PandaFramework, window: PointerTo<WindowFramework>) -> None

  2. 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.

Parameters:
nodeName: str

the name that will be used when inserting the node in the scene graph

modelPath: str

Path to the model file

Returns:

NodePath The NodePath containing the 3D model, which can now be added to the scene graph.

printStructure(self) None
renderFrame(self) None
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.

Parameters:
abort: bool

whether to abort (true) or display a message when an assertion fails.

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

setName(self, name: str) None
setNodePose(*args, **kwargs)

Overloaded function.

  1. 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

  1. 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

setRenderOrder(self, order: int) None
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

Parameters:
useVsync: bool

Whether to use vsync or not

static vispPointToPanda(point: visp._visp.core.ColVector) visp._visp.core.ColVector
static vispVectorToPanda(vec: visp._visp.core.ColVector) visp._visp.core.ColVector