CodingTrain / CodingTrain/Suggestion-Box

Octree and other BVH

Open
#1,515 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
570
Forks
85
PR merge metrics
No merged PRs in 30d

Description

Hi Daniel,

In a past coding challenge you explored quadtrees and demonstrated how a proper data structure can help into speeding up the search of object randomly distributed over a surface (the plane in that 2D example).

Would be interesting to see a challenge with more complex data structures, maybe in higher dimensions (3D - I wouldn't pretend to go above that), and show how kdtrees can be used to partition the space (instead of the plane) for fast information search.

A nice example could be a super simple raytracer where you place points in the space that should represent either the camera (so a point and a direction) or spheres (so a point and a magnitude for the radius).

Then you could, for ever draw call, shoot a ray for each pixel from the camera, through the projection plane, and into the scene.
If that ray hits the sphere, then you can color the pixel with the color of the sphere, and if it doesn't, then you can pick a background color.

Would be interesting to see the performance difference between NO data structure (just an array with spheres) and an octree or any other kdtree you think would be more fit for this purpose.

Would also be interesting to see how "rendering" time scales with the increase in complexity of the scene (adding more and more spheres, maybe thru a slider?)

Thoughts?

Here some references:
- [Conversion and Integration of Boundary Representations with Octrees](https://graphicsinterface.org/wp-content/uploads/gi1989-27.pdf)
- [An overview of quadtrees, octrees, and related hierarchical data structures](http://www.cs.umd.edu/~hjs/pubs/Samettfcgc88-ocr.pdf)
- [Octree implementation in Java](https://github.com/siddeshpillai/Octree)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.