bezier... and collision-test

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

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

Originally posted by mikael_aronsson:
[b]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[/b]

cheers,
thanks for the help mikael
martin

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

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