mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
REVIEWED: Examples section comments, for better organization and consistency
This commit is contained in:
@ -17,6 +17,9 @@
|
||||
|
||||
#define NUM_MODELS 9 // Parametric 3d shapes to generate
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Module Functions Declaration
|
||||
//------------------------------------------------------------------------------------
|
||||
static Mesh GenMeshCustom(void); // Generate a simple triangle mesh from code
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@ -136,6 +139,9 @@ int main(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Module Functions Definition
|
||||
//------------------------------------------------------------------------------------
|
||||
// Generate a simple triangle mesh from code
|
||||
static Mesh GenMeshCustom(void)
|
||||
{
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -24,6 +24,9 @@
|
||||
#define GLSL_VERSION 100
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Module Functions Declaration
|
||||
//------------------------------------------------------------------------------------
|
||||
// Generate cubemap (6 faces) from equirectangular (panorama) texture
|
||||
static TextureCubemap GenTextureCubemap(Shader shader, Texture2D panorama, int size, int format);
|
||||
|
||||
@ -183,6 +186,9 @@ int main(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Module Functions Definition
|
||||
//------------------------------------------------------------------------------------
|
||||
// Generate cubemap texture from HDR texture
|
||||
static TextureCubemap GenTextureCubemap(Shader shader, Texture2D panorama, int size, int format)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user