top of page

Convex Editor

Project Overview

Building BVH

For each convex, I calculate it's bouding AABB when I generate it, and build Bouding Volume Hierachy of AABBs recursively to acceleration raycast intersection. To manage convex, I only make leaf node could own a vector of convex.

Building BVH for Convex

Code For Building BVH Recusively

In my scene,with BVH is at least 3 times faster than without BVH, if the attribution of random rays are less random. The performance improvement will be greater. It only takes 13 ms with 130k rays vs 8 convex.

How Much Dose BVH Acceleration Intersection

Raycast vs Convex

Red point means inward point, green point means outward point. The ray hits a convex only when the middle point of last red point and the first green point is inside the convex.

Raycast vs Convex and Debug Draw

Code for Raycast vs Convex

Screenshots

  • LinkedIn
  • YouTube

© 2025 by Jiabin Portfolio. All rights reserved.

bottom of page