PDA

View Full Version : dynamically drawing



11-16-2000, 08:36 PM
hi all
I am doing a program where i pick points on the screen by clicking a mouse. i convert them to the window coords and store them in (x[i],y[i]).After each click of the screen i should see all the point(s) that i had clicked earlier.

to get this done,can i do something like this?
in the drawing function i have the following:
glBegin(GL_LINES);
for(i=0;i<count;i++) // count of number of clicks- gets updated after each click
{
glVertex3f(x[i],y[i],0.0);
}
glEnd();
this does not give me anything on the screen. Am i doing the coding correctly or should i check something else?
-prasad-

pseudo
11-16-2000, 10:01 PM
You can't define line with just one vertex. So, use glBegin(GL_POINTS).

jc
11-16-2000, 10:43 PM
As said pseudo, u can't draw a line with one vertex but u'r code is not wrong.
You'r count parameter should be a pair number.

Could you send the code just before the glbegin ??