<p>you don't need to build the tree again! Even when you translate / rotate / scale the object. The trick is to use a transformation matrix for the object. When you want to check, if e.g. a ray is hitting your object, you only need to transform the ray to the object space by multiplying the ray with the inverse transformation matrix.</p>
<p>So the ray will be transformed relative to the objects position / rotation / scale. The tree always stays the same.</p>
<p>Same for a plain test or frustum test.</p>
<p>The tree only needs to be updated, when the mesh is deformed. (e.g. softbodies)</p>

CC BY-SA 4.0
2023-09-21T10:05:49.023Z
It is useful to have a bounding sphere around the object as well. So when the ray hits the sphere, you can transform the ray into the object space and perform the tree search
Thomas
CC BY-SA 4.0
2023-09-21T10:03:01.673Z
2023-09-21T10:10:29.127Z
2023-09-21T10:10:29.127Z
Thomas
<p>I'm not a computer graphics engineer. I'm more of a quality engineer (primary language is C++). I've just started learning by myself about acceleration structures in computer graphics, especially Binary Space Partitioning (BSP) vs. Bounding Volume Hierarchy (BVH).</p>
<p>I understand that a BSP kind of has a built-in visibility culling algorithm thanks to the way it's built. For example, given a node X in a BSP tree, all nodes in X's left subtree are in front of X, and all nodes in X's right subtree are behind X. On the other hand, a BVH is like an AABB tree whose nodes represent the hierarchical bounding boxes of objects. Unlike BSP, a BVH needs an explicit visibility culling algorithm.</p>
<p>After building a BSP/BVH for objects in a 3D scene, if I change the camera's position (by rotating the scene, for example), I feel like for rendering the updated scene, the BVH won't need to be rebuilt because the bounding boxes remain relatively unchanged. We'll just need to run the explicit visibility culling algorithm on it again with the new viewpoint. The BSP will need to be rebuilt though because the front/back of a node in the BSP is now different with the new viewpoint. Am I understanding it correctly? Thank you in advance!</p>

<bounding-volume-hierarchy><space-partitioning>
Does a BSP tree need to be rebuilt every time the camera's position changes?
Marsupito
# Does a BSP tree need to be rebuilt every time the camera's position changes?

(Asked by: username_0 on 2023-09-20)

I'm not a computer graphics engineer. I'm more of a quality engineer (primary language is C++). I've just started learning by myself about acceleration structures in computer graphics, especially Binary Space Partitioning (BSP) vs. Bounding Volume Hierarchy (BVH).

I understand that a BSP kind of has a built-in visibility culling algorithm thanks to the way it's built. For example, given a node X in a BSP tree, all nodes in X's left subtree are in front of X, and all nodes in X's right subtree are behind X. On the other hand, a BVH is like an AABB tree whose nodes represent the hierarchical bounding boxes of objects. Unlike BSP, a BVH needs an explicit visibility culling algorithm.

After building a BSP/BVH for objects in a 3D scene, if I change the camera's position (by rotating the scene, for example), I feel like for rendering the updated scene, the BVH won't need to be rebuilt because the bounding boxes remain relatively unchanged. We'll just need to run the explicit visibility culling algorithm on it again with the new viewpoint. The BSP will need to be rebuilt though because the front/back of a node in the BSP is now different with the new viewpoint. Am I understanding it correctly? Thank you in advance!

**Tags:** bounding-volume-hierarchy, space-partitioning


---

## 1 answers

### Answer by username_1 on 2023-09-21. Score: 0 | Accepted answer

you don't need to build the tree again! Even when you translate / rotate / scale the object. The trick is to use a transformation matrix for the object. When you want to check, if e.g. a ray is hitting your object, you only need to transform the ray to the object space by multiplying the ray with the inverse transformation matrix.

So the ray will be transformed relative to the objects position / rotation / scale. The tree always stays the same.

Same for a plain test or frustum test.

The tree only needs to be updated, when the mesh is deformed. (e.g. softbodies)

> **Comments:**
> **username_1**: It is useful to have a bounding sphere around the object as well. So when the ray hits the sphere, you can transform the ray into the object space and perform the tree search  

---

