Skip to main content
GameDev.net gamedev.net
🔒 Locked

Point inside OOB

Started by taby Apr 27, 2025 at 7:51 PM 1 replies 1.8k views
Original Post
taby
taby

I have a model with a custom model matrix, and thus an oriented bounding box (OOB).

To test if a point is inside the OOB, should I multiply the inverse of the model matrix by the point, and testing against an axis-aligned bounding box (AABB) instead?

JoeJ
JoeJ

taby said:
To test if a point is inside the OOB, should I multiply the inverse of the model matrix by the point, and testing against an axis-aligned bounding box (AABB) instead?

Yes, but if you don't have the inverse around, you can also use the model matrix directly to inverse transform the point.
This works because for transformations the inverse usually equals the transpose. (But it does not work if a perspective projection is involved as well for example, iirc.)

Alternatively you can also generate a AABB from the OOBs corner points, bit this makes the box larger ofc.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.