|
|
@ -159,9 +159,9 @@ Mesh GenMeshPoints(int numPoints) |
|
|
|
// https://en.wikipedia.org/wiki/Spherical_coordinate_system |
|
|
|
for (int i = 0; i < numPoints; i++) |
|
|
|
{ |
|
|
|
float theta = PI*rand()/RAND_MAX; |
|
|
|
float phi = 2.0f*PI*rand()/RAND_MAX; |
|
|
|
float r = 10.0f*rand()/RAND_MAX; |
|
|
|
float theta = PI*rand()/p">(float)RAND_MAX; |
|
|
|
float phi = 2.0f*PI*rand()/p">(float)RAND_MAX; |
|
|
|
float r = 10.0f*rand()/p">(float)RAND_MAX; |
|
|
|
|
|
|
|
mesh.vertices[i*3 + 0] = r*sin(theta)*cos(phi); |
|
|
|
mesh.vertices[i*3 + 1] = r*sin(theta)*sin(phi); |
|
|
|