VertexBuffer and Bezier Curves

Started by
2 comments, last by Dreq 19 years, 4 months ago
Hi, I have a question about vertex buffers. id like to use a vertex buffer for rendering a landscape. Currently i use this code: for(int x=0;x<SIZE;x++) for(int y=0;y<SIZE;y++){ glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, (3*SIZE+1)*3, 4, &ctrlpoints[x*3][y*3][0]); glEnable(GL_MAP2_VERTEX_3); glMapGrid2f(20, 0.0, 1.0, 20, 0.0, 1.0); glColor3f(1.0, 1.0, 1.0); glEvalMesh2(GL_LINE, 0, 20, 0, 20); } Problem: the landscape is evaluated again for each frame. I wonder if it would somehow be possible to save the mesh to a vertexbuffer after generation. could u please give me a code example or tell me where to look it up? thx, Henning
Advertisement
u can generate the cureves yourself, theres plenty of info on the net on how to do this (it shouldnt be anyslower), glMap(..) is not gonna be done in hardware but on the cpu anyway
thx, ill try that then, i just found out, i can get the factors for the polynomes from OGL, that can save some time coding :) ill do it that way then.

some nice stuff u got there on ur hp, i like it.
This may be a complete shot in the dark, but if its a static terrain wouldn't a display list be a viable solution? I honestly haven't studied display lists yet (although its actuially what I'm going to teach myself tonight), but from what I understand it remembers how you draw the scene (inside the glNewList/glEndList blocks) and allows quick re-drawing of that scene. I could be completly wrong but it never hurts to try ;)
"Mommy, where do microprocessors come from?"

This topic is closed to new replies.

Advertisement