Reputation: 7164
I have this code which is supposed to draw a number of points on screen :
glBegin(GL_POINTS);
for(int i = 0; i < x; i++)
{
for(int j = 0; j < y; j++)
{
glColor3f(0,0,0);
glVertex3f(array1[i][j], array2[i][j], array3[i][j]);
cout<<array1[i][j]<<" "<<array2[i][j]<<" "<<array3[i][j]<<endl;
}
}
glEnd();
I only get one point on the screen. I can't imagine how this is happening. I am printing array values, they are all different, but I am getting only one point instead of a few hundred points. Can you tell what is wrong with this code?
Upvotes: 1
Views: 749
Reputation: 14730
It could be that either only one point out of your dataset falls in the viewport, or that all the points end up being projected to only one visible pixel. Either way you should check your projection range. You could extract the bounding box of your dataset and set the viewing volume to be slightly larger than that.
Upvotes: 2