Skip to content

Instantly share code, notes, and snippets.

@jakubtomsu
jakubtomsu / poly_obb.odin
Created August 2, 2025 13:54
A demo app showing how to compute tightest possible oriented bounding box of a 2D polygon
// A demo app showing how to compute tightest possible oriented bounding box/rectangle of a convex polygon.
// The order of edges matters, so the points should be in order. In case of convex polygons you can just radially sort them.
//
// By Jakub Tomšů
package poly_obb_demo
import "core:fmt"
import "core:math/linalg"
import rl "vendor:raylib"