From 303160787571f476c5013e500329d1e631f5b654 Mon Sep 17 00:00:00 2001 From: Reese Gallagher Date: Sat, 24 Aug 2024 11:17:06 -0400 Subject: [PATCH] address code convention comments --- examples/models/models_point_rendering.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/examples/models/models_point_rendering.c b/examples/models/models_point_rendering.c index 2405f18ec..7f0f98f1f 100644 --- a/examples/models/models_point_rendering.c +++ b/examples/models/models_point_rendering.c @@ -21,7 +21,6 @@ #define MIN_POINTS 1000 // 1 thousand static float RandFloat(); -static Mesh GenPoints(int numPoints); //------------------------------------------------------------------------------------ // Program main entry point @@ -52,7 +51,8 @@ int main() //-------------------------------------------------------------------------------------- // Main game loop - while(!WindowShouldClose()) { + while(!WindowShouldClose()) + { // Update //---------------------------------------------------------------------------------- UpdateCamera(&camera, CAMERA_ORBITAL); @@ -139,12 +139,6 @@ int main() return 0; } -// Random float between 0 and 1 -float RandFloat() -{ - return (float)rand() / RAND_MAX; -} - // Generate a spherical point cloud Mesh GenPoints(int numPoints) { @@ -158,9 +152,9 @@ Mesh GenPoints(int numPoints) // https://en.wikipedia.org/wiki/Spherical_coordinate_system for (int i = 0; i < numPoints; i++) { - float theta = PI * RandFloat(); - float phi = 2 * PI * RandFloat(); - float r = 10.0f * RandFloat(); + float theta = PI * rand() / RAND_MAX; + float phi = 2.0f * PI * rand() / RAND_MAX; + float r = 10.0f * rand() / RAND_MAX; mesh.vertices[i * 3 + 0] = r * sin(theta) * cos(phi); mesh.vertices[i * 3 + 1] = r * sin(theta) * sin(phi); mesh.vertices[i * 3 + 2] = r * cos(theta);