REVIEWED: Examples section comments, for better organization and consistency

This commit is contained in:
Ray
2025-09-03 10:40:31 +02:00
parent 1fa3c15942
commit c579eef4b7
19 changed files with 253 additions and 170 deletions

View File

@@ -18,11 +18,14 @@
#include "raylib.h"
#include <stdlib.h> // Required for: rand()
#include <math.h> // Required for: cos(), sin()
#include <math.h> // Required for: cosf(), sinf()
#define MAX_POINTS 10000000 // 10 million
#define MIN_POINTS 1000 // 1 thousand
//------------------------------------------------------------------------------------
// Module Functions Declaration
//------------------------------------------------------------------------------------
// Generate mesh using points
static Mesh GenMeshPoints(int numPoints);
@@ -148,6 +151,9 @@ int main()
return 0;
}
//------------------------------------------------------------------------------------
// Module Functions Definition
//------------------------------------------------------------------------------------
// Generate a spherical point cloud
static Mesh GenMeshPoints(int numPoints)
{
@@ -158,7 +164,7 @@ static Mesh GenMeshPoints(int numPoints)
.colors = (unsigned char*)MemAlloc(numPoints*4*sizeof(unsigned char)),
};
// https://en.wikipedia.org/wiki/Spherical_coordinate_system
// REF: https://en.wikipedia.org/wiki/Spherical_coordinate_system
for (int i = 0; i < numPoints; i++)
{
float theta = ((float)PI*rand())/((float)RAND_MAX);