frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

A fast 3D collision detection algorithm

https://cairno.substack.com/p/improvements-to-the-separating-axis
88•OlympicMarmoto•3h ago
I discovered this collision detection algorithm during COVID and finally got around to writing about it.

github repo: https://github.com/cairnc/sat_blog

Comments

double051•2h ago
Hey that's Ascension from Halo 2. Cool test case!
chickenzzzzu•42m ago
Real OGs know :) I used to love all of the super bounces and out of bounds tricks, though I think Ascension didn't really have many of the latter
reactordev•2h ago
This is novel indeed! What about non-spherical shapes? Do we assume a spherical bounds and just eat the cost? Either way, narrow phase gets extremely unwieldy when down to the triangle level. Easy for simple shapes but if you throw 1M vertices at it vs 1M vertices you’re going to have a bad time.

Any optimization to cut down on ray tests or clip is going to be a win.

bruce343434•1h ago
Most likely this can be preceded by testing branches of some spatial hierarchy datastructure, 1 million squared is a lot to compute no matter the algorithm
reactordev•1h ago
Without optimizations of the vertices buffer, correct, it’s a 1T loop. But we can work on faces and normals so that reduces it by a factor of 3. We can octree it further as well spatially but…

There’s a really clever trick Unreal does with their decimation algorithm to produce collision shapes if you need to. I believe it requires a bake step (pre-compute offline).

I’d be fine with a bake step for this.

OlympicMarmoto•47m ago
Do you mean non-convex shapes? You can do a convex decomposition and then test all pairs. Usually games accelerate this with a BVH.
andrewmcwatters•15m ago
Usually you have a render model and a physical model which is a degenerate version of the viewed object, with some objects tailored for picking up, or allowing objects to pass through a curved handle, etc.

I would assume using this algorithm wouldn't necessarily change that creation pipeline.

msteffen•40m ago
I'm trying to work through the math here, and I don't understand why these two propositions are equivalent:

1) min_{x,y} |x-y|^2

   x ∈ A

   y ∈ B
2) = min_{x,y} d

   d ≥ |x-y|^2

   x ∈ A

   y ∈ B
What is 'd'? If d is much greater than |x-y|^2 at the actual (x, y) with minimal distance, and equal to |x-y|^2 at some other (x', y'), couldn't (2) yield a different, wrong solution? Is it implied that 'd' is a measure or something, such that it's somehow constrained or bounded to prevent this?
mathgradthrow•15m ago
I can't read substack on my phone, so I can't see the article, but the correct statement that is closest to what you have written is just that d is any real number satisfying this inequality. We define a subset U of AxBxR by

U={(a,b,x):x>|a-b|^2}

and then were looking for the infimum of (the image of) U under the third coordinate function

d(a,b,x)=x

leoqa•22m ago
Aside: I learned the Sep Axis Theorem in school and often use it for interviews when asked about interesting algorithms. It's simple enough that you can explain it to non-technical folks. "If I have a flashlight and two objects, I can tell you if they're intersected by shining the light on it". Then you can explain the dot product of the faces, early-exit behavior and MTV.
Animats•5m ago
Nice. It's definitely an optimization problem. But you have to look at numerical error.

I had to do a lot of work on GJK convex hull distance back in the late 1990s. It's a optimization problem with special cases.

Closest points are vertex vs vertex, vertex vs edge, vertex vs face, edge vs edge, edge vs face, and face vs face. The last three can have non-unique solutions. Finding the closest vertices is easy but not sufficient. When you use this in a physics engine, objects settle into contact, usually into the non-unique solution space. Consider a cube on a cube. Or a small cube sitting on a big cube. That will settle into face vs face, with no unique closest points.

A second problem is what to do about flat polygon surfaces. If you tesselate, a rectangular face becomes two coplanar triangles. This can make GJK loop. If you don't tesselate, no polygon in floating point is truly flat. This can make GJK loop. Polyhedra with a minimum break angle between faces, something most convex hullers can generate, are needed.

Running unit tests of random complex polyhedra will not often hit the hard cases. A physics engine will. The late Prof. Steven Cameron at Oxford figured out solutions to this in the 1990s.[1] I'd discovered that his approach would occasionally loop. A safe termination condition on this is tough. He eventually came up with one. I had a brute force approach that detected a loop.

There's been some recent work on approximate convex decomposition, where some overlap is allowed between the convex hulls whose union represents the original solid. True convex decomposition tends to generate annoying geometry around smaller concave features, like doors and windows. Approximate convex decomposition produces cleaner geometry.[2] But you have to start with clean watertight geometry (a "simplex") or this algorithm runs into trouble.

[1] https://www.cs.ox.ac.uk/stephen.cameron/distances/

[2] https://github.com/SarahWeiii/CoACD

Ancient pathogen became deadlier when humans started wearing wool

https://www.nature.com/articles/d41586-025-01631-w
1•rntn•32s ago•0 comments

OpenAI to release web browser in challenge to Google Chrome

https://www.reuters.com/business/media-telecom/openai-release-web-browser-challenge-google-chrome-2025-07-09/
1•jmsflknr•1m ago•0 comments

LangChain is about to become a unicorn, sources say

https://techcrunch.com/2025/07/08/langchain-is-about-to-become-a-unicorn-sources-say/
1•clemo_ra•2m ago•0 comments

Finding PBHs Using the LSST Will Be a Statistical Challenge – Universe Today

https://www.universetoday.com/articles/finding-pbhs-using-the-lsst-will-be-a-statistical-challenge
1•rbanffy•3m ago•0 comments

<Now Go Bang > the REM-Arkable Misadventures of List

https://www.masswerk.at/nowgobang/2025/the-remarkable-misadventures-of-list
1•rbanffy•4m ago•0 comments

brotab: Control your browser's tabs from the command line

https://github.com/balta2ar/brotab
1•pseudalopex•4m ago•0 comments

Desktop Publishing Tools That Didn't Make It

https://tedium.co/2022/10/12/forgotten-desktop-publishing-tools-history/
1•rbanffy•4m ago•0 comments

The Hungry, Hungry AI Model

https://tomtunguz.com/input-output-ratio/
1•speckx•5m ago•0 comments

Program for Framework 16 LED Matrix

https://boyne.dev/projects/fwmm.html
1•DedFishy•6m ago•1 comments

Strategic connection between JuliaHub, Dyad and Julia open source community

https://juliahub.com/blog/the-strategic-connection-between-juliahub-dyad-and-the-julia-open-source-community
1•darboux•8m ago•0 comments

Show HN: Browse Developer Portfolios

https://www.webportfolios.dev
1•yeahimjt•8m ago•0 comments

Generative Blocks World: Moving Things Around in Pictures

https://arxiv.org/abs/2506.20703
2•PaulHoule•11m ago•0 comments

Pope Leo Signed a Popplio 'Pokémon' Card

https://gizmodo.com/pope-leo-signed-popplio-card-pokemon-2000626305
3•ulrischa•13m ago•0 comments

Show HN: AI-powered simulations to practice real-life decisions (free sample)

https://promptquest.co/first-time-manager-simulation-free/
2•ronstark•13m ago•1 comments

AI Makes It Look Good. Craft Makes It Matter

https://story.vjy.me/53
2•realvjy•14m ago•0 comments

Solar becomes top source of electricity in California

https://pv-magazine-usa.com/2025/07/09/solar-becomes-top-source-of-electricity-in-california/
8•martinpw•14m ago•3 comments

Researchers studied turtle necropsies for cancer to overturn theory

https://www.discoverwildlife.com/animal-facts/reptiles/study-finds-cancer-extremely-rare-in-turtles
1•thunderbong•16m ago•0 comments

Databricks-SQL at Your Agent's Fingertips via MCP in GitHub Copilot

https://aymenfurter.ch/articles/databricks-sql-at-your-agents-fingertips-via-mcp-in-github-copilot/
1•aymenfurter•16m ago•0 comments

Implantable device could save diabetes patients from dangerously low blood sugar

https://news.mit.edu/2025/implantable-device-could-save-diabetes-patients-low-blood-sugar-0709
3•gnabgib•19m ago•0 comments

Five Things to Know About Record Copper Prices

https://www.wsj.com/finance/commodities-futures/copper-prices-tariffs-explained-a6644db7
5•sandwichsphinx•20m ago•0 comments

2025 in LLMs so far, illustrated by Pelicans on Bicycles – Simon Willison [video]

https://www.youtube.com/watch?v=YpY83-kA7Bo
2•swyx•20m ago•1 comments

Amelia Earhart Aircraft Expedition: Satellite Photos Spot Long-Lost Wreckage?

https://www.LeonardDavid.com/amelia-earhart-aircraft-expedition-satellite-photos-spot-long-lost-wreckage/
1•speckx•22m ago•1 comments

22 stone blocks, pieces Of Lighthouse Of Alexandria, pulled from sea

https://allthatsinteresting.com/lighthouse-of-alexandria-remains
1•bookofjoe•23m ago•0 comments

How US Export Controls Have (and Haven't) Curbed Chinese AI

https://ai-frontiers.org/articles/us-chip-export-controls-china-ai
3•jonbaer•23m ago•0 comments

Recipients of a U.S. Climate Science Fellowship Are Put on Unpaid Leave

https://www.nytimes.com/2025/07/09/climate/noaa-fellows-unpaid-leave.html
3•jmsflknr•25m ago•0 comments

The plight of the misunderstood atomic memory ordering

https://www.grayolson.me/blog/posts/misunderstood-memory-ordering/
3•fanf2•26m ago•0 comments

Show HN: KCast

https://github.com/Agundur-KDE/KCast
1•Agundur•27m ago•0 comments

Ask HN: Why do my posts sometimes become popular and sometimes invisible?

2•FerkiHN•29m ago•2 comments

Tech Philosophy and AI Opportunity

https://stratechery.com/2025/tech-philosophy-and-ai-opportunity/
1•jonbaer•29m ago•0 comments

HMQ: Principal Type Inference Under a Prefix

https://www.microsoft.com/en-us/research/publication/principal-type-inference-under-a-prefix/
1•ctenb•30m ago•0 comments