BoundingBox

Attributes

BoundingBox([extents])

Class for representing object bounding boxes.

Details

class psychopy.visual.BoundingBox(extents=None)[source]

Class for representing object bounding boxes. This is a lazy-imported class, therefore import using full path from psychopy.visual.stim3d import BoundingBox when inheriting from it.

A bounding box is a construct which represents a 3D rectangular volume about some pose, defined by its minimum and maximum extents in the reference frame of the pose. The axes of the bounding box are aligned to the axes of the world or the associated pose.

Bounding boxes are primarily used for visibility testing; to determine if the extents of an object associated with a pose (eg. the vertices of a model) falls completely outside of the viewing frustum. If so, the model can be culled during rendering to avoid wasting CPU/GPU resources on objects not visible to the viewer.

_computeCorners()[source]

Compute the corners of the bounding box.

These values are cached to speed up computations if extents hasn’t been updated.

clear()[source]

Clear a bounding box, invalidating it.

property extents
fit(verts)[source]

Fit the bounding box to vertices.

property isValid

True if the bounding box is valid.


Back to top