Пытаюсь получить координаты сферы формула тут - https://ru.onlinemschool.com/math/formula/sphere/ Код вот:
GLfloat *buf = new GLfloat[197820*9];
GLfloat x, y, z,r=0.5;
int count = 0;
GLfloat arr1[9];
int n;
for (GLfloat i = 0; i <= 3.14; i += 0.01)
for (GLfloat j = 0; j <= 2.0 * 3.14; j += 0.01)
{
x = r * (GLfloat)sin(i) * (GLfloat)cos(j);
y = r * (GLfloat)sin(i) * (GLfloat)sin(j);
z = r * (GLfloat)cos(i);
arr1[0] = x;
arr1[1] = y;
arr1[2] = z;
arr1[3] = 1.0;//R
arr1[4] = 0.0;//G
arr1[5] = 0.0;//B
arr1[6] = 1.0;//A
arr1[7] = 0.0;//S
arr1[8] = 0.0;//T
count++;
n = sizeof(arr1) / sizeof(arr1[0]);
std::copy(arr1, arr1 + n, buf);
}
std::cout << "n"<<n<<"count" << count<<"buf"<< sizeof(GLfloat) * 197820 *9;
...
f->glDrawArrays(GL_POINTS, 0, 197820);