Bezier patches and collision

Started by
10 comments, last by Intamin AG 19 years, 9 months ago
i have a quake3-like engine and i can render bezier patches. Now the problem is: how can i manage collisions with them?
Advertisement
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..
The world isn't unpredictable. It's CHAOTIC.
where can i find some base infos or tuts? somebody knows an useful link?
nehe has a simple collision detection tut which covers sphere to cylinder, plane & sphere collisions
The world isn't unpredictable. It's CHAOTIC.
Quote:Original post by Intamin AG
nehe has a simple collision detection tut which covers sphere to cylinder, plane & sphere collisions


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

nehe.gamedev.net
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
The world isn't unpredictable. It's CHAOTIC.
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
The world isn't unpredictable. It's CHAOTIC.
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.
--------------------------------------------------------There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.There is another theory which states that this has already happened...
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
The world isn't unpredictable. It's CHAOTIC.

This topic is closed to new replies.

Advertisement