Hi ppl,
I have an array of 3D coordinates of some points that i want to display on screen. Let the array be called displayStrokes3D, the coordinates are in double format. Below is my pseudocode…
if displayStrokes3D is true,
{
glColor3f (1.0,1.0,1.0);
glLineWidth (2);
glBegin(GL_LINE_STRIP);
for every element in displayStrokes3D
{
glVertex3d(displayStrokes3D[i].x, displayStrokes3D[i].y, displayStrokes3D[i].z);
}//end for loop
glEnd();
}
This segment of code is in my Render function and it is called whenever i add more points into displayStrokes3D array and then i call glutPostRedisplay(); Points are added as i add the (x,y) of mouse coordinates when i drag the mouse.
By right, the line strip will get longer and longer when i add more points. However, sometimes i see the full line strip on screen and sometimes, the line strips seems cut off at some place, and some times i don’t see any lines on the screen at all…why is this so?
I do not see any wrong in my code or logic, maybe some one can enlighten me or spot my mistakes. Thanks!