<p>I wrote the code for checking intersection of ray and meshes on scene. It consist of two parts - broad phase and narrow phase.
In broad phase I build an oriented bounding box around each mesh and check intersection of ray with boxes.
In narrow phase I check intersection of ray and each triangle of the meshes from broad phase using Möller-Trumbore algorithm. In general it works well.
Now my task is to optimize broad phase using Octree. Octree as data structure is well-described and trivial enough. However, I have no idea how to apply it for raytracing and I can't find nothing about it. Could you please give me a hint? </p>

CC BY-SA 4.0
2019-05-31T09:25:33.507Z
Try reading "Raytracing Complex Scenes" by Kajiya.
gallickgunner
CC BY-SA 4.0
2019-05-31T11:22:20.360Z
@gallickgunner Assuming you meant Kay and Kajiya's paper, I'm not sure it suggests using Octrees, but they do cite earlier works by Glassner and Kaplan which do, e.g.  Glassner's *"Space Subdivision for Fast Ray Tracing,"* IEEE Computer Graphics
and Applications, Oct 1984
Simon F
CC BY-SA 4.0
2019-06-01T00:00:12.463Z
@SimonF - Yeah, Kajiya doesn't explain what an octree is but defines a whole algorithm (using a heap) how to go about using it in raytracing. And I think that's what the OP wanted, that's why.
gallickgunner
<raytracing><3d>
Using octree for cheking intersection of ray and meshes
NikBond
# Using octree for cheking intersection of ray and meshes

(Asked by: username_0 on 2019-05-30)

I wrote the code for checking intersection of ray and meshes on scene. It consist of two parts - broad phase and narrow phase.
In broad phase I build an oriented bounding box around each mesh and check intersection of ray with boxes.
In narrow phase I check intersection of ray and each triangle of the meshes from broad phase using Möller-Trumbore algorithm. In general it works well.
Now my task is to optimize broad phase using Octree. Octree as data structure is well-described and trivial enough. However, I have no idea how to apply it for raytracing and I can't find nothing about it. Could you please give me a hint?

**Tags:** raytracing, 3d

> **Comments:**
> **username_1**: Try reading "Raytracing Complex Scenes" by Kajiya.  
> **username_2**: @username_1 Assuming you meant Kay and Kajiya's paper, I'm not sure it suggests using Octrees, but they do cite earlier works by Glassner and Kaplan which do, e.g.  Glassner's *"Space Subdivision for Fast Ray Tracing,"* IEEE Computer Graphics and Applications, Oct 1984  
> **username_1**: @username_2 - Yeah, Kajiya doesn't explain what an octree is but defines a whole algorithm (using a heap) how to go about using it in raytracing. And I think that's what the OP wanted, that's why.  

---

## 0 answers

