0
我需要解釋下面的代碼。在opengl中形成圓的座標背後的邏輯
float stepSize = ((2*M_PI)/POINTS_1349);
for (float d = 0; d <= (2*M_PI)-stepSize; d += stepSize) {
pPointer->x = sin(d) * 0.5; //0.5 is radius
pPointer->y = cos(d) * 0.5;
pPointer->z = 0.0f;
pPointer->w = 1.0f;
pPointer++;
}
其中POINTS表示用於形成圓的點的數量。 M_PI = 3.14