View Full Version : Draw many vertexs with the motion speed fast
03-03-2009, 02:31 PM
I try to draw around 20.000 vertexes with textures but the motion animation is slow when run the program.
I have a file (.txt) with 20.000 vertexes vectorial directions; the program read the file perfectly; charge the arrays with the data; and show the scene but very slow. How I do for the motion will be normal (fast) and not slow.
the structure is read array file (.txt) use glvertexf();
that program is with opengl and delphi 6
03-03-2009, 03:03 PM
So your object data is static ? Then use a display list or better a VBO (vertex buffer object).
20000 vertices is very small, should not be a problem. What is you hardware ?
03-03-2009, 03:09 PM
i'm not sure that would be the problem but, either way, you could (should!) try a better solution for rendering those vertex.
glVertex*() is the slowest way possible to draw geometry.
Better than that are Display Lists, Vertex Arrays and then VBO as options.
You can google those terms around and learn a bit more about each.
You could start with Vertex Arrays as they are basically rendering from an array of vertex coordinates, and you seem to have one. You basically enable the feature and tell OpenGl which is your array and draw it all (or parts of it) with a single call, rather than looping for the whole it and making a call for each vertex.
edit: beat me to it :(
03-03-2009, 05:37 PM
Yes, I need a some example code about vertex arrays but in delphi+opengl; I see what its the problem; so I believe so glvertexf() is so very slow way to draw many vertexes.
VBO no is support by my AGP card
PD. the data is dinamic. get from a file (.txt) this records are generated and saved with the same program.
03-03-2009, 07:45 PM
If VBOs are not supported then load the vertex data into main memory, and then use glDrawArrays or glDrawElements to draw from client space.
Don't know much about Delphi I am afraid.. But I found this useful when wanting to understand the concept..
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.