PDA

View Full Version : bezier... and collision-test



martinzwigl
08-28-2001, 08:56 AM
hi folks

two questions:
1. in opengl-bezier i know the first, the last and the control-points. let us say i want to know to additional points ON the curve (1/4 and 3/4) with a given value. where do i put the control-points.
2. how to do collision-test on a bezier-patch.

thanks for the help,
martin

mikael_aronsson
08-28-2001, 10:36 PM
Hi !

You have to evaluate the bezier yourself, OpenGL does not have a way to do this so that you can access the coordinates. You could a look at the code in Mesa GLU or I think they have bezier evaluation code at for example http://www.gamedev.net

Please notice that evaluating beziers is not very fast (even though it can be).

Using beziers in collision detection can also be tricky, at least for any realtime stuff (it's not very fast). But I guess it can be done, though I don't have any good idea on how to do it at the moment.

Mikael

martinzwigl
08-29-2001, 01:35 AM
Originally posted by mikael_aronsson:
Hi !

You have to evaluate the bezier yourself, OpenGL does not have a way to do this so that you can access the coordinates. You could a look at the code in Mesa GLU or I think they have bezier evaluation code at for example http://www.gamedev.net

Please notice that evaluating beziers is not very fast (even though it can be).

Using beziers in collision detection can also be tricky, at least for any realtime stuff (it's not very fast). But I guess it can be done, though I don't have any good idea on how to do it at the moment.

Mikael

cheers,
thanks for the help mikael
martin

ps: do you know why it is that bezier is "slower" then triangles?

mikael_aronsson
08-29-2001, 04:52 AM
Hi !

You cannot render a bezier curve or surface, you have to tesselate it into line strips or triangles first, that's the part that slows it all down a bit, once you have done that there is no difference in speed.

And bezier's themself are not that slow, it's just that the evaluation code takes some time to execute so be a little careful when you use it in realtime applications.

So if you have a static bezier you can tesselate it first and then use the tesselated data when you run your application for example.

Mikael