Jump to content
  • Advertisement
Sign in to follow this  
Poldi

VertexBuffer and Bezier Curves

This topic is 4961 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

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

Share this post


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

Share this post


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

Share this post


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

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!