Ok, thanks, i figured it out, now......there's another problem.... for example i did something like this:
http://puu.sh/2f7Gu
as u can see, added vertices all around the circles (need to do some management down the line and if look at the console, you can see that both points are the same but theyt shouldn't be what i did was basically this:
void draw() {
glBegin(GL_POLYGON);
for(mAngle = 0.0; mAngle <= 2 * 3.14; mAngle += (3.14/this->mNumSegments))
{
glVertex2d(mXpos + mRadius * -cos(mAngle),
mYpos + mRadius * sin(mAngle));
glColor3d(mRed,mGreen,mBlue);
}
glColor3d(mRed,1,1);
glEnd();
for(mAngle = 0.0; mAngle <= 2 * 3.14; mAngle += (3.14/mNumSegments))
{
for(int i = 0; i < mNumSegments; i++)
{
points.reserve(i);
points.resize(i);
points.push_back(new Points);
glColor3d(1,0,0);
for(vector<Points*>::iterator i = points.begin(); i != points.end(); i++)
{
Points* p = (*i);
if(p != NULL) {
p->setPosition(mXpos + mRadius * cos(mAngle),
mYpos + mRadius * sin(mAngle));
glPointSize(5);
p->draw();
}
else
{
delete p;
p = 0;
}
}
}
}
as u can see, it adds 1 point to each segment of the circle. I added this to an array vector so i know it works. As you can see, all the points render to their respective segments on the circle. My problem is getting the points and them being different.....as i said, I got two points that I thought would be with different values since all the points got rendered to the circle, I figured it would be ok........but it's not.
Points* getPoint(int index)
{
vector<Points*>::iterator i = points.begin();
for(i; i != points.end();i++)
{
return points[index];
}
}
this gets the points based on index (ignore that for loop doesn't really do anything.....so you would expect p[0] and p[1] to have different values? but they don't. this is the same problem i've been having in java with a programming assignment in class.
here's what im trying to do (you might of guessed from the screen shot.)
cout << "Num of points = " << faces[0]->getNumPoints() << endl;
Points* p1 = faces[0]->getPoint(0);
cout << "p0 pos = " << p1->getX() << " " << p1->getY() << endl;
glBegin(GL_LINES);
glVertex2d(p1->getX(),p1->getY());
glVertex2d(p1->getX()+40,p1->getY()+10);
glEnd();
Points* p2 = faces[0]->getPoint(4);
cout << "p1 pos = " << p2->getX() << " " << p2->getY() << endl;
glBegin(GL_LINES);
glVertex2d(p2->getX(),p2->getY());
glVertex2d(p2->getX()+10,p2->getY()+10);
glEnd();