I am trying to use subwindows to generate an object out of a curve by rotating it. I am able to generate all the curves. Now I have also divided the window in two parts. I want to draw curves in the left subwindow and want to generate a solid by rotating it along an axis in the right. I am not able to draw anything in the right subwindow.
Edit:
Ok this is how I am drawing dots in the left part. The dots are basically clicks by user. I capture those events and make a list and then using a for loop print them.
// This function takes a list of points and draws the dots in the screen
void drawDot(vector<vec2> listPts)
{
glBegin(GL_POINTS);
glColor3f(1.0,1.0,1.0);
if(j==0) // J=0 means points are being added using add option, no insert after is currently being used
{
for(int i=0;i<listPts.size();i++)
{
glVertex2i(listPts[i].x,listPts[i].y);
}
}
else if(j!=0)// this else part is for making selected points look red, as for this j!=0
{
for(int i=0;i<listPts.size();i++)
{
if(i==j ) // make only the selected point red
{
glColor3f(1.0,0.0,0.0);
glVertex2i(listPts[i].x,listPts[i].y);
}
else // rest all the points are same as before i.e. white
{
glColor3f(1.0,1.0,1.0);
glVertex2i(listPts[i].x,listPts[i].y);
}
}
}
glEnd();
glFlush();
}
Now suppose I have a set of points. I just want to draw in the right subwindow the same points just to see if it is working. So, I have created a button and when ever I press the button, I want to switch to the right window and draw something. I used debug in VS2010 and checked that if the drawing func is at all called and it is being called and still nothing comes in the screen.
this is the function I am using to draw in the second window.
void drawDotWin2(vector<vec2> listPts)
{
glBegin(GL_POINTS);
glColor3f(1.0,1.0,1.0);
for(int i=0;i<listPts.size();i++)
{
glVertex2i(listPts[i].x,listPts[i].y);
}
glEnd();
glutWireTeapot (0.5);
glFlush();
}
when I press the button. the above function is called but nothing happens. Is my co-ordinate system wrong? I didn't do much to set the coordinate system though.