DevMaster.net Forums
[[ Home | Forums | 3D Engines Database | Wiki | Articles/Tutorials | Game Dev Jobs | IRC Chat Network | Contact Us ]]

Go Back   DevMaster.net Forums > Site Discussions > Articles Discussion
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old 09-27-2003, 10:37 PM   #1
DmEditor
DevMaster Editor
 
Join Date: Jan 2005
Posts: 54
Default

Physics in BSP-Trees: Collision Detection
Author: Samuel Ranta-Eskola
Description: The article discusses the implementation of physics in BSP-Trees. Topics covered are: Future Position Calculation, Collision Detection, and Collision Handling.

Reply to this post for any comments/suggestions/questions.
DmEditor is offline   Reply With Quote
Old 09-27-2003, 11:48 PM   #2
anubis
DevMaster Staff
 
anubis's Avatar
 
Join Date: Apr 2003
Location: Germany
Posts: 2,328
Default

cool... third installment !!! very nice ! i'll read it tomorrow !
___________________________________________
If Prolog is the answer, what is the question ?
anubis is offline   Reply With Quote
Old 09-27-2003, 11:52 PM   #3
Dia Kharrat
DevMaster Staff
 
Join Date: Jan 2003
Posts: 1,201
Default

actually this is the forth installment
Dia Kharrat is offline   Reply With Quote
Old 09-28-2003, 10:31 AM   #4
Extrawurst
New Member
 
Join Date: Sep 2003
Posts: 13
Thumbs up

Is this actually the last Tutorial covering this theme? :nervous:
Extrawurst is offline   Reply With Quote
Old 09-28-2003, 10:34 AM   #5
Noor
Senior Member
 
Join Date: Jan 2003
Location: ON, Canada
Posts: 524
Default

Quote:
Is this actually the last Tutorial covering this theme?

in terms of these articles in the series, yes. But writers might submit related topics in the future...
___________________________________________
"What ever happened to happily ever after?"
Noor is offline   Reply With Quote
Old 09-28-2003, 10:48 AM   #6
anubis
DevMaster Staff
 
anubis's Avatar
 
Join Date: Apr 2003
Location: Germany
Posts: 2,328
Default

fourth ? oh sorry... yes fourth, one must have slipped my mind
___________________________________________
If Prolog is the answer, what is the question ?
anubis is offline   Reply With Quote
Old 10-20-2003, 03:26 AM   #7
Mihail121
Senior Member
 
Mihail121's Avatar
 
Join Date: Jan 2003
Posts: 868
Default

Hey guys i know there is a full PDF document that covers the whole tutorials. Could anyone please point me to where can i find it?
Mihail121 is offline   Reply With Quote
Old 10-21-2003, 09:33 AM   #8
Samuel
New Member
 
Join Date: Sep 2003
Location: Uppsala, Sweden
Posts: 8
Default

http://www.gamedev.net/reference/programmi...bsptree/bsp.pdf
Samuel is offline   Reply With Quote
Old 10-23-2003, 04:49 AM   #9
Mihail121
Senior Member
 
Mihail121's Avatar
 
Join Date: Jan 2003
Posts: 868
Default

Thanks, if you are the author of those tutorials than know that they are really very proffesional. They combine good explanations and sample source. Everything one needs in order to start coding!
Mihail121 is offline   Reply With Quote
Old 10-23-2003, 10:43 AM   #10
Samuel
New Member
 
Join Date: Sep 2003
Location: Uppsala, Sweden
Posts: 8
Default

Thank you for your kind words

I tried to write the report in a way that would make it easy to "follow in my footsteps".

The main thing with the report is that it should encourage you to think for yourself. The solutions I provide are very basic and aren't fit for larger scale projects. But it will, as you mention, get you started.
Samuel is offline   Reply With Quote
Old 04-01-2004, 08:15 PM   #11
Dan East
New Member
 
Join Date: Apr 2004
Posts: 3
Default

Hi. I've found this article helpful, but while attempting to implement this algorithm I have run into some details that don't appear to be covered. I emailed the author a couple weeks ago, but since I have not received a response I am posting here.

In the second phase of collision detection (the first phase being to determine if the object has even crossed the plane of the polygon) the algorithm uses perpendicular planes to check if the object falls within the edges of the polygon. However this test uses "Object.Position" which is not defined or discussed anywhere within the document.

Does anyone have insight into what Object.Position represents? Since the object is in motion it is represented by Object.StartPosition and Object.EndPosition. Thus Object.Position must be some point on that line, but this is not discussed. It should not be the point on the polygon plane where the line segment crosses, because that does not take into account the bounding volume of the ellipsoid. It seems it should be the point on the line that is CALCULATE-COLLISIONRADIUS() units from the polygon plane. Is this correct?

Thanks!

Dan East
Dan East is offline   Reply With Quote
Old 04-01-2004, 08:40 PM   #12
Dia Kharrat
DevMaster Staff
 
Join Date: Jan 2003
Posts: 1,201
Default

I think the email that's in the article is invalid. He recently posted on this thread:
http://www.devmaster.net/forums/index.php?...p?showtopic=532

According to that thread, the email he uses is: krassa at hotmail.com

Just tell him to check this thread, and he'll post it his answer here.
Dia Kharrat is offline   Reply With Quote
Old 04-02-2004, 08:08 AM   #13
Dan East
New Member
 
Join Date: Apr 2004
Posts: 3
Default

I'll drop him an email.

Quote:
Originally Posted by Dan East
It seems it should be the point on the line that is CALCULATE-COLLISIONRADIUS() units from the polygon plane. Is this correct?

After thinking about it a bit more, that isn't correct either. However I believe this may be the proper technique:

Find the point p1 on the motion line segment that is CALCULATE-COLLISIONRADIUS() units from the polygon plane.

Find the point p2 where the motion line segment intersects the polygon plane.

The segment (p1, p2) now represents the potential range of collision against the polygon using the ellipsoid volume.

Code:
for each edge plane { calculate D1 and D2 (the distance from edge plane to p1 and p2) if (D1 and D2 are behind edge plane) return NO_COLLISION; //no collision occured if (D1 and D2 are in front of edge plane) continue; //iterate to next edge plane set p3 to the point where segment (p1, p2) intersects edge plane if (D1 is in front of edge plane and D2 is behind edge plane) { p2=p3; continue; //iterate to next edge plane } //Assume D1 is behind edge plane and D2 is in front of edge plane p1=p3; } //Collision occured //p1 should be the point where the collision occured. return COLLISION;

I haven't tested this, but I believe this will yield proper results. I'll post back here after I've implemented it.

Dan East
Dan East is offline   Reply With Quote
Old 04-05-2004, 01:08 AM   #14
Samuel
New Member
 
Join Date: Sep 2003
Location: Uppsala, Sweden
Posts: 8
Default

After reading my article I realized the unclarity regarding Object.Position. When looking at Dan East's solution I find it a more exact way to solve collisions, at a higher cost though.

I think I chose to represent Object.Position as the position where the move crossed the polygon. This can render in some minor problems when passing corners, where a polygon actually would be to close but be discarded since the Position would be outside polygon. But I don't think this will generate and cruel bugs so you can easily go with that solution too. (depending on how much juice want to spend If you want a more exact solution go with Dan East's..
Samuel is offline   Reply With Quote
Old 05-02-2004, 04:14 AM   #15
deseg
New Member
 
Join Date: May 2004
Posts: 1
Default

I think the article is good but the author should have provided concrete example and not only pseudo code. I don’t understand how to calculate Object.xzColl and Object.yColl and I think the formula for calculating collision radius should be explained in more details.


CALCULATE-COLLISIONRADIUS (Object, Direction)
1 return Sqrt((Object.xzColl * Direction.x)2 +
(Object.yColl * Direction.y)2 +
(Object.xzColl * Direction.z)2)

Also what is Polygon.Distance?
deseg is offline   Reply With Quote
Old 08-21-2004, 02:25 PM   #16
Samuel
New Member
 
Join Date: Sep 2003
Location: Uppsala, Sweden
Posts: 8
Default

Hi there.

CALCULATE-COLLISIONRADIUS calculates the radius of the ellipsoid containing the character to perform collision detection on. Object.xzColl is the radius for the ellipsiod in th ex-z plane while Object.yColl is the radius (i.e. half the height of the character) in y space. It was a couple of years since I wrote this and now I've realized there are quite a few ways better to do the collision detection (boxes or just one plain sphere at a predefined height.


Polygon.distance is the d coefficient in the plane equation (x+y+z+d), meaning the distance from origo along the normal -> a plane with the normal <1,0,0> that cuts through the x-axis at x=500 has d=500. To calculate the distance you just input any of the points in the polygon into this formula:

d=-(polygon.point dot polgyon.normal)

Hope I clarified some things for you.

Regards
Samuel Ranta-Eskola
Samuel is offline   Reply With Quote
Old 10-06-2005, 05:45 PM   #17
ikk
Member
 
Join Date: Sep 2005
Location: Somewhere in Poland
Posts: 87
Default Re: Physics in BSP-Trees: Collision Detection

nevertheless i liked the article, its last sentnce scared me, as in other ones
ikk is offline   Reply With Quote
Old 04-14-2006, 10:24 AM   #18
gabest
New Member
 
Join Date: Apr 2006
Location: Budapest
Posts: 1
Default Re: Physics in BSP-Trees: Collision Detection

Hi,
I liked the article very much, and I have some further questions.
1. My biggest problem with this algorithm is the sphere can pass through adjecencing triangles if their normals enclose a big angle (more than 90). It is because the sphere can pass the triangles by not passing their shifted planes. Maybe it could be solved by inserting additional triangles to the risky places, but there could be better solutuions too.
2. I think that checking if the collision point of the moving plane and the shifted plane, is inside the perpendicular planes or not is not enough to decide if a collision happend or not. It could be better testing the whole moving line against the shifted perp. planes...
If you think i am not correct or have some solutions, please tell me! If it is not understandable i could send some figures better representing the problems.

Thanks, Gábor
gabest is offline   Reply With Quote
Old 08-23-2007, 11:53 PM   #19
goruka
Member
 
Join Date: Jan 2007
Posts: 32
Default Re: Physics in BSP-Trees: Collision Detection

After using Stan Melax's dynamic plane shifting for a while, I want to give a try to this technique...
DPS is extremely picky with the geometry i feed to it, and in many cases not very accurate. This one is probably much slower and CPU hungry though, but i imagine a lot more precise, and shouldn't baffle with not-so-good geometry.
goruka is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Forum Jump


All times are GMT -7. The time now is 07:44 AM.


Powered by vBulletin
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.