Jump to content
  • Advertisement
Sign in to follow this  
b3rs3rk

Bezier patches and collision

This topic is 5095 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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..

Share this post


Link to post
Share on other sites
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 -___-

Share this post


Link to post
Share on other sites
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 this post


Link to post
Share on other sites
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 this post


Link to post
Share on other sites
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 this post


Link to post
Share on other sites
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 this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!