Hi guys,
at the moment i have about 3000 Points in about 5500 triangles and my System (Athlon 2000, 64mb gfx card) slow down when my openGL window has to display them.
The big trouble is that i need to display alot of more points in the future
I have all Points and triangles stored in two vector.
When i render the scene i do the following:
std::vector<std::vector<double> > MyMeshPoints = controller->m_Datas.getMeshPoints();
std::vector<std::vector<double> > MyMeshTriangles = controller->m_Datas.getMeshTriangles();
int iAmountMeshTriangles = MyMeshTriangles.size();
int l,m,n;
glLineWidth(0.5);
glColor4f (0.0, 0.0, 0.4,0.5);
glPolygonMode(GL_FRONT, GL_LINE);
for (int k=0; k<iAmountMeshTriangles; k++)
{
l = MyMeshTriangles[k][0];
m = MyMeshTriangles[k][1];
n = MyMeshTriangles[k][2];
glBegin(GL_TRIANGLES);
GLfloat iPointx = convertRechengebietX_ToOpenGL(MyMeshPoints[l][1]);
GLfloat iPointy = convertRechengebietY_ToOpenGL(MyMeshPoints[l][2]);
glVertex2f(iPointx,iPointy);
iPointx = convertRechengebietX_ToOpenGL(MyMeshPoints[m][1]);
iPointy = convertRechengebietY_ToOpenGL(MyMeshPoints[m][2]);
glVertex2f(iPointx,iPointy);
iPointx = convertRechengebietX_ToOpenGL(MyMeshPoints[n][1]);
iPointy = convertRechengebietY_ToOpenGL(MyMeshPoints[n][2]);
glVertex2f(iPointx,iPointy);
glEnd();
}
It would be nice if someone could give me some hints, what i could do to improve my code.
And a second simple question.
I have the possibility to zoom and scroll inside my openGL window.I do it by recalculating all points and redrawing the scene every time.
Is there a better solution?
thx in advance
daSickboy [daNoob]