我在qt中有这两个方法的圆圈:
void MyGLWidget::drawCircle() {
int n = vertices.count();
qglColor(Qt::white);
glBegin(GL_POLYGON);
for(int i = 0; i < n; i++) {
glVertex2f(vertices[i].first, vertices[i].second);
}
glEnd();
}
void MyGLWidget::calculateVetices()
{
double a = 3.14 / 90;
vertices.append(QPair<double, double> (0,0));
for(int i = 0; i <= 360; i++) {
vertices.append(QPair<double, double> (cos(i * a) * radius, sin(i * a) * radius));
}
}
现在我想获得这个圈子的当前位置。我怎样才能做到这一点?