Bezier patches and collision

Recommended Posts

b3rs3rk    216
i have a quake3-like engine and i can render bezier patches. Now the problem is: how can i manage collisions with them?

Share on other sites
Intamin AG    122
I dunno how complex you want them? you can use edge/face tests in the most extreme case, bounding box/bounding whatever tests, bounding whatever/plane tests... and the lists go on..

Share on other sites
b3rs3rk    216
where can i find some base infos or tuts? somebody knows an useful link?

Share on other sites
Intamin AG    122
nehe has a simple collision detection tut which covers sphere to cylinder, plane & sphere collisions

Share on other sites
b3rs3rk    216
Quote:
 Original post by Intamin AGnehe has a simple collision detection tut which covers sphere to cylinder, plane & sphere collisions

i LOVE when someone gives me a VERY USEFUL answer -___-

Ciehoo    128

nehe.gamedev.net

Share on other sites
Intamin AG    122
thats useful alright... :P

nah I'm writing some collision detection tests now so if u can give me a day or two I can help... I hope

Share on other sites
Intamin AG    122
I had encountered a minor error which rendered my ray-triangle test useless which I hadn't manage to spot until now so expect a dlay.. the two day time limit starts over :P

Here is basically what I will do:

Store simple object in model structure (tris with vert pointers and vert list)

Store bezier patch in other model structure

Start off with bezier patch at origin and object couple units above it, with cursor keys and pageup/ pagedown to move it around

Test each triangle of simple object with each triangle in patch in this way:

loop through tris in simple object{  loop through tris in complex object  {    cola = CheckEdge1;    colb = CheckEdge2;    colc = CheckEdge3;        if(cola || colb || colc)       RenderRedAndPutText;    else       RenderGreen;  }}

put out text message and render colliding polygons as red (actually intersecting polygons) and others as green

Share on other sites
Corrail    133
Ture Bezier-Patch collision detection is VERY HARD to implement (from the mathematical point of view).
I'd recommend you to do a adaptive collision tesslation. Remember that a bezier patch is allways within the convex hull of the control points. This means that you can make a bounding volumn around your control points and then first to test the collision against this bounding volumn.
Then you tesslate the bezier patch into triangles and do a collision detection against this triangles if a more exact collision detection is needed.

Share on other sites
Intamin AG    122
I am assuming a low precision "true patch" collision hull in my demo so I sont need to do a bounding volume test..

like I have a 12 pollie box to test against an 16x16x2 (512) or 8x8x2 (128) bezier patch collision hull

I dont really need to optimise to give this guy what he needs but in the end in my engine I wil have spacial partitioning and bounding volume tests in between of course

Share on other sites
JazzD    127
you can easily fake the collision detection by setting weapclip brushes in gtkradiant, q3map will not render them but add node brushes, it looks very realistic when you collide with the "fake node" then. If you want to know more ask me on msn berserk :)

Share on other sites
Intamin AG    122
he said he has a quake3 like engine, not THE quake3 engine...

I am making my tri-tri tests a bit more accurate, then I'll add the bezier patch... this code is far from optimal but is very accurate