Hi,
I have an vertex array to hold more than 300 vertex. I need use those data to draw a mesh on the screen.
I wrote the following code for doing that. However, I got almost nothing on the screen.
I really don’t know what is going on?
My vertex array like this:
{ -76.3074 36.9634 -3.0000
-76.3297 36.9633 -4.8000
-76.3134 36.9632 -2.1000
-76.3014 36.9632 -2.7000
-76.3503 36.9632 -13.1000
-76.3169 36.9629 -2.7000
-76.3263 36.9629 -1.2000
-76.3186 36.9629 -0.9000
-76.3314 36.9627 -6.4000
-76.3134 36.9627 -2.1000
…
}
…
glBegin (GL_QUAD_STRIP);
for (int i = 0; i < 300; i++)
{
int j = i + 1;
int k = i + 2;
int n = i + 3;
float xi = m_TotalPointsArray[i].x;
float yi = m_TotalPointsArray[i].y;
float zi = m_TotalPointsArray[i].z;
float xj = m_TotalPointsArray[j].x;
float yj = m_TotalPointsArray[j].y;
float zj = m_TotalPointsArray[j].z;
float xk = m_TotalPointsArray[k].x;
float yk = m_TotalPointsArray[k].y;
float zk = m_TotalPointsArray[k].z;
float xn = m_TotalPointsArray[n].x;
float yn = m_TotalPointsArray[n].y;
float zn = m_TotalPointsArray[n].z;
glColor3f (0.0f, 1.0f, 0.f);
glVertex3f(xi, yi, zi);
glVertex3f(-xj, yj, zj);
glVertex3f(-xk, -yk, zk);
glVertex3f(xn, yn, zn);
}
glEnd();
Thank you for help