Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / 2D OBB Collision Detection

Author
Message
Proteus 1935
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Brazil
Posted: 26th Feb 2004 06:31 Edited at: 26th Feb 2004 06:33
Hey all,

I'm looking for some explanation on Oriented Bounding Boxes Collision Detection (Rotatable Bounding Boxes) but can't seem to find it . I only need it in 2d (So I guess it would be oriented rectangle collision?)... Can anyone help?

ps.It can be in any programming language/pseudocode/Drawing cards/for dummies book... lol

Currently coding: VideoCapture Plug-in (cameras)
Recent coding: Momentum concervative collision response
Proteus
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 26th Feb 2004 07:10
Oi, Proteus. O que está fazendo aqui a esta hora? Nunca dorme?

If I understand what you're trying to do, then its not really worth the
effort (or the computer processes) using a square bounding box. You
should probably be better off using a circular collision instead. It
would be alot faster to make, and probably run much faster too.

(1 + 2 + 3 + 4)^2 =(1^3)+(2^3)+(3^3)+(4^3)
100=1+8+27+64
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 26th Feb 2004 08:08
but be less accurate.

"eureka" - Archimedes
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 26th Feb 2004 09:38
That depends on the shape of the object.
What if it's a top down view, and he's
shooting at an oil barrel?

(1 + 2 + 3 + 4)^2 =(1^3)+(2^3)+(3^3)+(4^3)
100=1+8+27+64
Proteus 1935
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Brazil
Posted: 26th Feb 2004 15:55
+Thanks for the replies:

@TKF15H Dormir? que é isso? lol

You see I already use sphere (circular since it's 2d) collision detection together with a space division trick (ie. 2d space is divided into sectors so each unit will only check for collision with units in the nearby sectors) using linked lists,but what I'm looking for is to refine my collision detection system(so it'll check the sectors then check circular detection only THEN to check OBB)...

Now several sphere-like collision checks might work...And I'd only need a few lines of code in my "unit editor"...

Anyway for now I'm still looking for OBB resources

Currently coding: VideoCapture Plug-in (cameras)
Recent coding: Momentum concervative collision response
Proteus
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 26th Feb 2004 17:14
Quote: "Dormir? que é isso? lol"

Na verdade, eu não tenho certeza. Tá vendo a que horas mandei minha mensagem?

Using a rotateing rectangular colision box would probably
be slower than pixel perfect colision.

(1 + 2 + 3 + 4)^2 =(1^3)+(2^3)+(3^3)+(4^3)
100=1+8+27+64
Magellan
21
Years of Service
User Offline
Joined: 21st Feb 2004
Location: 001110101
Posted: 26th Feb 2004 17:24
Yeah, seriously. I am using pixel perfect collision via memblocks for my 2D game and it runs quite well. If you need any help, let me know.
Proteus 1935
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Brazil
Posted: 26th Feb 2004 18:30
@TKF15H : Nossa o cara não dorme mesmo!Ficou vendo o incêndio na tv?

@Magellan : Think I've seen your game around (worms like right?) looks very nice from the screenie I've seen congratulations!
My problem is that, well ,I'm using 3d graphics(Mainly textured plains) but I only need 2d logic (since all my object are on the same plane), that's why i'm looking for OBB...In order to use pixel perfect I'd need to use sprites... & I don't know if rotated ones would work...

Currently coding: VideoCapture Plug-in (cameras)
Recent coding: Momentum concervative collision response
Proteus
haggisman
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 26th Feb 2004 22:44 Edited at: 26th Feb 2004 22:59
Heres a super quick try at what i think you want, its very messy and uses sprites for display purposes, but the collision detection is not reliant on the them being sprites.



EDIT: oops made a silly mistake

Defying the convention of an upright avatar since 1985
Proteus 1935
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Brazil
Posted: 26th Feb 2004 23:47
Thanks haggisman , think thats just what I needed!
I'll dissect it now

Currently coding: VideoCapture Plug-in (cameras)
Recent coding: Momentum concervative collision response
Proteus
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 27th Feb 2004 03:55
@Proteus: Por que ver o incendio na TV quando posso ver pela janela?

(1 + 2 + 3 + 4)^2 =(1^3)+(2^3)+(3^3)+(4^3)
100=1+8+27+64

Login to post a reply

Server time is: 2025-06-08 03:49:01
Your offset time is: 2025-06-08 03:49:01