18
18
#include "raylib.h"
19
19
20
20
#include <stdlib.h> // Required for: rand()
21
- #include <math.h> // Required for: cos (), sin ()
21
+ #include <math.h> // Required for: cosf (), sinf ()
22
22
23
23
#define MAX_POINTS 10000000 // 10 million
24
24
#define MIN_POINTS 1000 // 1 thousand
25
25
26
+ //------------------------------------------------------------------------------------
27
+ // Module Functions Declaration
28
+ //------------------------------------------------------------------------------------
26
29
// Generate mesh using points
27
30
static Mesh GenMeshPoints (int numPoints );
28
31
@@ -148,6 +151,9 @@ int main()
148
151
return 0 ;
149
152
}
150
153
154
+ //------------------------------------------------------------------------------------
155
+ // Module Functions Definition
156
+ //------------------------------------------------------------------------------------
151
157
// Generate a spherical point cloud
152
158
static Mesh GenMeshPoints (int numPoints )
153
159
{
@@ -158,7 +164,7 @@ static Mesh GenMeshPoints(int numPoints)
158
164
.colors = (unsigned char * )MemAlloc (numPoints * 4 * sizeof (unsigned char )),
159
165
};
160
166
161
- // https://en.wikipedia.org/wiki/Spherical_coordinate_system
167
+ // REF: https://en.wikipedia.org/wiki/Spherical_coordinate_system
162
168
for (int i = 0 ; i < numPoints ; i ++ )
163
169
{
164
170
float theta = ((float )PI * rand ())/((float )RAND_MAX );
0 commit comments