0

I am using glEvalMesh1() to calculate the coordinates of a Bézier curve and draw the curve. To be honest I had a hard time finding out how this function works because I am a complete newbie in 3D graphics. Now I managed to draw the curve this way:

glLineWidth(PATH_LINE_WIDTH);
glMap1d(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, PATH_CONTROL_POINTS, (double *) &(path->control_points[0]));
glEnable(GL_MAP1_VERTEX_3);
glMapGrid1d(50, 0, 1);
glEvalMesh1(GL_LINE, 0, 50);

I need to get the calculated coordinates for certain segments of the curve or the whole curve because I need to perform physics-related calculations.

Tamás
  • 298
  • 3
  • 14
  • Note that the `glEvalMesh` functions and friends are really old, depreciated, and removed from modern OpenGL. You might have a better time rewriting them yourself. – Colonel Thirty Two Nov 16 '14 at 16:18
  • Thanks for your comment. Actually if they does the magic I don't care about them being old and deprecated. But the problem is I don't know whether this can be done using these functions. If not, then I will have no other option than to implement this myself as you suggested. – Tamás Nov 16 '14 at 16:44
  • glEvalMesh1 is a linear interpolator, how is that related to generating Bezier coordinates? You're generating regularly spaced euclidean coordinates. – Mike 'Pomax' Kamermans Nov 16 '14 at 17:20
  • I'm sorry, as I've already mentioned I had a hard time finding out how these functions work and maybe I still don't understand it completely. So glMapGrid1d() is generating my Bézier coordinates and glEvalMesh1() display the curve. At least I think so... But the problem remains, I need to get these coordinates to do physics-related calculations. – Tamás Nov 16 '14 at 17:42
  • of the curves, or of the entire mesh? Because the curve's control points are right there in `path->control_points`, so just plug them into whatever physics computation you need to do. – Mike 'Pomax' Kamermans Nov 17 '14 at 16:24

0 Answers0