Add Color to DrawGrid

This commit is contained in:
Xphalnos 2025-08-20 17:27:13 +02:00
parent 99cb82a82c
commit eea83f02b3
38 changed files with 44 additions and 64 deletions

View File

@ -77,7 +77,7 @@ int main(void)
ClearBackground(RAYWHITE); ClearBackground(RAYWHITE);
BeginMode3D(camera); BeginMode3D(camera);
DrawGrid(10, 2); DrawGrid(10, 2, GRAY);
DrawSphere(spherePos, 0.5f, RED); DrawSphere(spherePos, 0.5f, RED);
EndMode3D(); EndMode3D();

View File

@ -116,7 +116,7 @@ int main ()
rlPushMatrix(); rlPushMatrix();
rlTranslatef(0, 25*50, 0); rlTranslatef(0, 25*50, 0);
rlRotatef(90, 1, 0, 0); rlRotatef(90, 1, 0, 0);
DrawGrid(100, 50); DrawGrid(100, 50, GRAY);
rlPopMatrix(); rlPopMatrix();
// Draw a reference circle // Draw a reference circle

View File

@ -63,7 +63,7 @@ int main(void)
DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED);
DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON); DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON);
DrawGrid(10, 1.0f); DrawGrid(10, 1.0f, GRAY);
EndMode3D(); EndMode3D();

View File

@ -59,7 +59,7 @@ int main(void)
DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED);
DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON); DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON);
DrawGrid(10, 1.0f); DrawGrid(10, 1.0f, GRAY);
EndMode3D(); EndMode3D();

View File

@ -95,7 +95,7 @@ int main(void)
} }
DrawRay(ray, MAROON); DrawRay(ray, MAROON);
DrawGrid(10, 1.0f); DrawGrid(10, 1.0f, GRAY);
EndMode3D(); EndMode3D();

View File

@ -122,7 +122,7 @@ int main(void)
DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED);
DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON); DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON);
DrawGrid(40, 1.0f); DrawGrid(40, 1.0f, GRAY);
EndMode3D(); EndMode3D();
EndVrStereoMode(); EndVrStereoMode();

View File

@ -65,7 +65,7 @@ int main(void)
DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED);
DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON); DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON);
DrawGrid(10, 1.0f); DrawGrid(10, 1.0f, GRAY);
EndMode3D(); EndMode3D();

View File

@ -89,7 +89,7 @@ int main(void)
DrawCube(anims[0].framePoses[animFrameCounter][i].translation, 0.2f, 0.2f, 0.2f, RED); DrawCube(anims[0].framePoses[animFrameCounter][i].translation, 0.2f, 0.2f, 0.2f, RED);
} }
DrawGrid(10, 1.0f); // Draw a grid DrawGrid(10, 1.0f, GRAY); // Draw a grid
EndMode3D(); EndMode3D();

View File

@ -82,7 +82,7 @@ int main(void)
BeginMode3D(camera); BeginMode3D(camera);
DrawGrid(10, 1.0f); // Draw a grid DrawGrid(10, 1.0f, GRAY); // Draw a grid
// Draw order matters! // Draw order matters!
if (distanceStatic > distanceRotating) if (distanceStatic > distanceRotating)

View File

@ -153,7 +153,7 @@ int main(void)
DrawMesh(equipModel[i].meshes[0], equipModel[i].materials[1], matrixTransform); DrawMesh(equipModel[i].meshes[0], equipModel[i].materials[1], matrixTransform);
} }
DrawGrid(10, 1.0f); DrawGrid(10, 1.0f, GRAY);
EndMode3D(); EndMode3D();
DrawText("Use the T/G to switch animation", 10, 10, 20, GRAY); DrawText("Use the T/G to switch animation", 10, 10, 20, GRAY);

View File

@ -107,7 +107,7 @@ int main(void)
// Draw player // Draw player
DrawCubeV(playerPosition, playerSize, playerColor); DrawCubeV(playerPosition, playerSize, playerColor);
DrawGrid(10, 1.0f); // Draw a grid DrawGrid(10, 1.0f, GRAY); // Draw a grid
EndMode3D(); EndMode3D();

View File

@ -72,7 +72,7 @@ int main(void)
DrawCubeTextureRec(texture, (Rectangle){ 0.0f, texture.height/2.0f, texture.width/2.0f, texture.height/2.0f }, DrawCubeTextureRec(texture, (Rectangle){ 0.0f, texture.height/2.0f, texture.width/2.0f, texture.height/2.0f },
(Vector3){ 2.0f, 1.0f, 0.0f }, 2.0f, 2.0f, 2.0f, WHITE); (Vector3){ 2.0f, 1.0f, 0.0f }, 2.0f, 2.0f, 2.0f, WHITE);
DrawGrid(10, 1.0f); // Draw a grid DrawGrid(10, 1.0f, GRAY); // Draw a grid
EndMode3D(); EndMode3D();

View File

@ -71,7 +71,7 @@ int main(void)
DrawCapsule ((Vector3){-3.0f, 1.5f, -4.0f}, (Vector3){-4.0f, -1.0f, -4.0f}, 1.2f, 8, 8, VIOLET); DrawCapsule ((Vector3){-3.0f, 1.5f, -4.0f}, (Vector3){-4.0f, -1.0f, -4.0f}, 1.2f, 8, 8, VIOLET);
DrawCapsuleWires((Vector3){-3.0f, 1.5f, -4.0f}, (Vector3){-4.0f, -1.0f, -4.0f}, 1.2f, 8, 8, PURPLE); DrawCapsuleWires((Vector3){-3.0f, 1.5f, -4.0f}, (Vector3){-4.0f, -1.0f, -4.0f}, 1.2f, 8, 8, PURPLE);
DrawGrid(10, 1.0f); // Draw a grid DrawGrid(10, 1.0f, GRAY); // Draw a grid
EndMode3D(); EndMode3D();

View File

@ -98,7 +98,7 @@ int main(void)
// Draw character mesh, pose calculation is done in shader (GPU skinning) // Draw character mesh, pose calculation is done in shader (GPU skinning)
DrawMesh(characterModel.meshes[0], characterModel.materials[1], characterModel.transform); DrawMesh(characterModel.meshes[0], characterModel.materials[1], characterModel.transform);
DrawGrid(10, 1.0f); DrawGrid(10, 1.0f, GRAY);
EndMode3D(); EndMode3D();

View File

@ -67,7 +67,7 @@ int main(void)
DrawModel(model, mapPosition, 1.0f, RED); DrawModel(model, mapPosition, 1.0f, RED);
DrawGrid(20, 1.0f); DrawGrid(20, 1.0f, GRAY);
EndMode3D(); EndMode3D();

View File

@ -126,7 +126,7 @@ int main(void)
DrawModel(model, position, 1.0f, WHITE); // Draw 3d model with texture DrawModel(model, position, 1.0f, WHITE); // Draw 3d model with texture
DrawGrid(20, 10.0f); // Draw a grid DrawGrid(20, 10.0f, GRAY); // Draw a grid
if (selected) DrawBoundingBox(bounds, GREEN); // Draw selection box if (selected) DrawBoundingBox(bounds, GREEN); // Draw selection box

View File

@ -80,7 +80,7 @@ int main(void)
BeginMode3D(camera); BeginMode3D(camera);
DrawModel(model, position, 1.0f, WHITE); // Draw animated model DrawModel(model, position, 1.0f, WHITE); // Draw animated model
DrawGrid(10, 1.0f); DrawGrid(10, 1.0f, GRAY);
EndMode3D(); EndMode3D();
DrawText("Use the LEFT/RIGHT mouse buttons to switch animation", 10, 10, 20, GRAY); DrawText("Use the LEFT/RIGHT mouse buttons to switch animation", 10, 10, 20, GRAY);

View File

@ -147,7 +147,7 @@ int main(void)
} }
} }
DrawGrid(10, 1.0f); // Draw a grid DrawGrid(10, 1.0f, GRAY); // Draw a grid
EndMode3D(); EndMode3D();

View File

@ -168,7 +168,7 @@ int main(void)
BeginMode3D(camera); BeginMode3D(camera);
DrawModel(models[currentModel], modelpos, 1.0f, WHITE); DrawModel(models[currentModel], modelpos, 1.0f, WHITE);
DrawGrid(10, 1.0); DrawGrid(10, 1.0, GRAY);
// Draw spheres to show where the lights are // Draw spheres to show where the lights are
for (int i = 0; i < MAX_LIGHTS; i++) for (int i = 0; i < MAX_LIGHTS; i++)

View File

@ -97,7 +97,7 @@ int main(void)
BeginMode3D(camera); BeginMode3D(camera);
DrawModel(models[currentModel], position, 1.0f, WHITE); DrawModel(models[currentModel], position, 1.0f, WHITE);
DrawGrid(10, 1.0); DrawGrid(10, 1.0, GRAY);
EndMode3D(); EndMode3D();

View File

@ -199,7 +199,7 @@ int main(void)
DrawRay(ray, MAROON); DrawRay(ray, MAROON);
DrawGrid(10, 10.0f); DrawGrid(10, 10.0f, GRAY);
EndMode3D(); EndMode3D();

View File

@ -80,7 +80,7 @@ int main(void)
DrawCylinder((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, GOLD); DrawCylinder((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, GOLD);
DrawCylinderWires((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, PINK); DrawCylinderWires((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, PINK);
DrawGrid(10, 1.0f); // Draw a grid DrawGrid(10, 1.0f, GRAY); // Draw a grid
EndMode3D(); EndMode3D();

View File

@ -108,7 +108,7 @@ int main(void)
// Some reference elements (not affected by previous matrix transformations) // Some reference elements (not affected by previous matrix transformations)
DrawCircle3D((Vector3){ 0.0f, 0.0f, 0.0f }, earthOrbitRadius, (Vector3){ 1, 0, 0 }, 90.0f, Fade(RED, 0.5f)); DrawCircle3D((Vector3){ 0.0f, 0.0f, 0.0f }, earthOrbitRadius, (Vector3){ 1, 0, 0 }, 90.0f, Fade(RED, 0.5f));
DrawGrid(20, 1.0f); DrawGrid(20, 1.0f, GRAY);
EndMode3D(); EndMode3D();

View File

@ -157,7 +157,7 @@ int main(void)
rlEnableBackfaceCulling(); rlEnableBackfaceCulling();
rlEnableDepthMask(); rlEnableDepthMask();
DrawGrid(10, 1.0f); DrawGrid(10, 1.0f, GRAY);
EndMode3D(); EndMode3D();

View File

@ -69,7 +69,7 @@ int main()
BeginMode3D(camera); BeginMode3D(camera);
DrawGrid(10, 5.0f); DrawGrid(10, 5.0f, GRAY);
for (int x = 0; x < numBlocks; x++) for (int x = 0; x < numBlocks; x++)
{ {

View File

@ -96,7 +96,7 @@ int main(void)
BeginMode3D(camera); BeginMode3D(camera);
DrawModel(model, (Vector3){ 0.0f, -8.0f, 0.0f }, 1.0f, WHITE); // Draw 3d model with texture DrawModel(model, (Vector3){ 0.0f, -8.0f, 0.0f }, 1.0f, WHITE); // Draw 3d model with texture
DrawGrid(10, 10.0f); DrawGrid(10, 10.0f, GRAY);
EndMode3D(); EndMode3D();

View File

@ -103,7 +103,7 @@ static void ErrorCallback(int error, const char *description);
static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods); static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods);
// Drawing functions (uses rlgl functionality) // Drawing functions (uses rlgl functionality)
static void DrawGrid(int slices, float spacing); static void DrawGrid(int slices, float spacing, Color color);
static void DrawCube(Vector3 position, float width, float height, float length, Color color); static void DrawCube(Vector3 position, float width, float height, float length, Color color);
static void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); static void DrawCubeWires(Vector3 position, float width, float height, float length, Color color);
static void DrawRectangleV(Vector2 position, Vector2 size, Color color); static void DrawRectangleV(Vector2 position, Vector2 size, Color color);
@ -213,7 +213,7 @@ int main(void)
DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED);
DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, RAYWHITE); DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, RAYWHITE);
DrawGrid(10, 1.0f); DrawGrid(10, 1.0f, DARKGRAY);
// Draw internal render batch buffers (3D data) // Draw internal render batch buffers (3D data)
rlDrawRenderBatchActive(); rlDrawRenderBatchActive();
@ -295,28 +295,15 @@ static void DrawRectangleV(Vector2 position, Vector2 size, Color color)
} }
// Draw a grid centered at (0, 0, 0) // Draw a grid centered at (0, 0, 0)
static void DrawGrid(int slices, float spacing) static void DrawGrid(int slices, float spacing, Color color)
{ {
int halfSlices = slices / 2; int halfSlices = slices / 2;
rlBegin(RL_LINES); rlBegin(RL_LINES);
rlColor4ub(color.r, color.g, color.b, color.a);
for (int i = -halfSlices; i <= halfSlices; i++) for (int i = -halfSlices; i <= halfSlices; i++)
{ {
if (i == 0)
{
rlColor3f(0.5f, 0.5f, 0.5f);
rlColor3f(0.5f, 0.5f, 0.5f);
rlColor3f(0.5f, 0.5f, 0.5f);
rlColor3f(0.5f, 0.5f, 0.5f);
}
else
{
rlColor3f(0.75f, 0.75f, 0.75f);
rlColor3f(0.75f, 0.75f, 0.75f);
rlColor3f(0.75f, 0.75f, 0.75f);
rlColor3f(0.75f, 0.75f, 0.75f);
}
rlVertex3f((float)i*spacing, 0.0f, (float)-halfSlices*spacing); rlVertex3f((float)i*spacing, 0.0f, (float)-halfSlices*spacing);
rlVertex3f((float)i*spacing, 0.0f, (float)halfSlices*spacing); rlVertex3f((float)i*spacing, 0.0f, (float)halfSlices*spacing);

View File

@ -120,7 +120,7 @@ int main(void)
else DrawSphereWires(lights[i].position, 0.2f, 8, 8, ColorAlpha(lights[i].color, 0.3f)); else DrawSphereWires(lights[i].position, 0.2f, 8, 8, ColorAlpha(lights[i].color, 0.3f));
} }
DrawGrid(10, 1.0f); DrawGrid(10, 1.0f, GRAY);
EndMode3D(); EndMode3D();

View File

@ -95,7 +95,7 @@ int main(void)
BeginMode3D(camera); // Begin 3d mode drawing BeginMode3D(camera); // Begin 3d mode drawing
DrawModel(model, position, 0.5f, WHITE); // Draw 3d model with texture DrawModel(model, position, 0.5f, WHITE); // Draw 3d model with texture
DrawGrid(10, 1.0f); // Draw a grid DrawGrid(10, 1.0f, GRAY); // Draw a grid
EndMode3D(); // End 3d mode drawing, returns to orthographic 2d mode EndMode3D(); // End 3d mode drawing, returns to orthographic 2d mode
DrawText("TEXT DRAWN IN RENDER TEXTURE", 200, 10, 30, RED); DrawText("TEXT DRAWN IN RENDER TEXTURE", 200, 10, 30, RED);

View File

@ -125,7 +125,7 @@ int main(void)
DrawCubeV((Vector3){ 0.0f, 0.5f, 1.0f }, (Vector3){ 1.0f, 1.0f, 1.0f }, PURPLE); DrawCubeV((Vector3){ 0.0f, 0.5f, 1.0f }, (Vector3){ 1.0f, 1.0f, 1.0f }, PURPLE);
DrawCubeWiresV((Vector3){ 0.0f, 0.5f, -1.0f }, (Vector3){ 1.0f, 1.0f, 1.0f }, DARKGREEN); DrawCubeWiresV((Vector3){ 0.0f, 0.5f, -1.0f }, (Vector3){ 1.0f, 1.0f, 1.0f }, DARKGREEN);
DrawCubeV((Vector3) { 0.0f, 0.5f, -1.0f }, (Vector3){ 1.0f, 1.0f, 1.0f }, YELLOW); DrawCubeV((Vector3) { 0.0f, 0.5f, -1.0f }, (Vector3){ 1.0f, 1.0f, 1.0f }, YELLOW);
DrawGrid(10, 1.0f); DrawGrid(10, 1.0f, GRAY);
EndShaderMode(); EndShaderMode();
EndMode3D(); EndMode3D();
EndTextureMode(); EndTextureMode();

View File

@ -84,7 +84,7 @@ int main(void)
DrawModel(model, position, 0.2f, WHITE); // Draw 3d model with texture DrawModel(model, position, 0.2f, WHITE); // Draw 3d model with texture
DrawGrid(10, 1.0f); // Draw a grid DrawGrid(10, 1.0f, GRAY); // Draw a grid
EndMode3D(); EndMode3D();

View File

@ -138,7 +138,7 @@ int main(void)
BeginMode3D(camera); // Begin 3d mode drawing BeginMode3D(camera); // Begin 3d mode drawing
DrawModel(model, position, 0.1f, WHITE); // Draw 3d model with texture DrawModel(model, position, 0.1f, WHITE); // Draw 3d model with texture
DrawGrid(10, 1.0f); // Draw a grid DrawGrid(10, 1.0f, GRAY); // Draw a grid
EndMode3D(); // End 3d mode drawing, returns to orthographic 2d mode EndMode3D(); // End 3d mode drawing, returns to orthographic 2d mode
EndTextureMode(); // End drawing to texture (now we have a texture available for next passes) EndTextureMode(); // End drawing to texture (now we have a texture available for next passes)

View File

@ -121,7 +121,7 @@ int main(void)
DrawModel(model1, (Vector3){ 0.5f, 0.0f, 0.0f }, 1, WHITE); DrawModel(model1, (Vector3){ 0.5f, 0.0f, 0.0f }, 1, WHITE);
DrawModelEx(model2, (Vector3){ -0.5f, 0.0f, 0.0f }, (Vector3){ 1.0f, 1.0f, 0.0f }, 50, (Vector3){ 1.0f, 1.0f, 1.0f }, WHITE); DrawModelEx(model2, (Vector3){ -0.5f, 0.0f, 0.0f }, (Vector3){ 1.0f, 1.0f, 0.0f }, 50, (Vector3){ 1.0f, 1.0f, 1.0f }, WHITE);
DrawModel(model3,(Vector3){ 0.0f, 0.0f, -1.5f }, 1, WHITE); DrawModel(model3,(Vector3){ 0.0f, 0.0f, -1.5f }, 1, WHITE);
DrawGrid(10, 1.0f); // Draw a grid DrawGrid(10, 1.0f, GRAY); // Draw a grid
EndMode3D(); EndMode3D();

View File

@ -86,7 +86,7 @@ int main(void)
DrawModel(model, (Vector3){ 0.0f, 0.0f, 0.0f }, 2.0f, WHITE); DrawModel(model, (Vector3){ 0.0f, 0.0f, 0.0f }, 2.0f, WHITE);
EndShaderMode(); EndShaderMode();
DrawGrid(10, 1.0f); DrawGrid(10, 1.0f, GRAY);
EndMode3D(); EndMode3D();

View File

@ -84,7 +84,7 @@ int main(void)
DrawCubeV((Vector3){ 0.0f, 0.5f, 1.0f }, (Vector3){ 1.0f, 1.0f, 1.0f }, PURPLE); DrawCubeV((Vector3){ 0.0f, 0.5f, 1.0f }, (Vector3){ 1.0f, 1.0f, 1.0f }, PURPLE);
DrawCubeWiresV((Vector3){ 0.0f, 0.5f, -1.0f }, (Vector3){ 1.0f, 1.0f, 1.0f }, DARKGREEN); DrawCubeWiresV((Vector3){ 0.0f, 0.5f, -1.0f }, (Vector3){ 1.0f, 1.0f, 1.0f }, DARKGREEN);
DrawCubeV((Vector3) { 0.0f, 0.5f, -1.0f }, (Vector3){ 1.0f, 1.0f, 1.0f }, YELLOW); DrawCubeV((Vector3) { 0.0f, 0.5f, -1.0f }, (Vector3){ 1.0f, 1.0f, 1.0f }, YELLOW);
DrawGrid(10, 1.0f); DrawGrid(10, 1.0f, GRAY);
EndShaderMode(); EndShaderMode();
EndMode3D(); EndMode3D();
EndTextureMode(); EndTextureMode();

View File

@ -285,7 +285,7 @@ int main(void)
DrawCubeV(cubePosition, cubeSize, dark); DrawCubeV(cubePosition, cubeSize, dark);
DrawCubeWires(cubePosition, 2.1f, 2.1f, 2.1f, light); DrawCubeWires(cubePosition, 2.1f, 2.1f, 2.1f, light);
DrawGrid(10, 2.0f); DrawGrid(10, 2.0f, GRAY);
// Use a shader to handle the depth buffer issue with transparent textures // Use a shader to handle the depth buffer issue with transparent textures
// NOTE: more info at https://bedroomcoders.co.uk/posts/198 // NOTE: more info at https://bedroomcoders.co.uk/posts/198

View File

@ -1551,7 +1551,7 @@ RLAPI void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int slice
RLAPI void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color); // Draw capsule wireframe with the center of its sphere caps at startPos and endPos RLAPI void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color); // Draw capsule wireframe with the center of its sphere caps at startPos and endPos
RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ
RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line
RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) RLAPI void DrawGrid(int slices, float spacing, Color color); // Draw a grid (centered at (0, 0, 0))
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// Model 3d Loading and Drawing Functions (Module: models) // Model 3d Loading and Drawing Functions (Module: models)

View File

@ -1068,22 +1068,15 @@ void DrawRay(Ray ray, Color color)
} }
// Draw a grid centered at (0, 0, 0) // Draw a grid centered at (0, 0, 0)
void DrawGrid(int slices, float spacing) void DrawGrid(int slices, float spacing, Color color)
{ {
int halfSlices = slices/2; int halfSlices = slices/2;
rlBegin(RL_LINES); rlBegin(RL_LINES);
rlColor4ub(color.r, color.g, color.b, color.a);
for (int i = -halfSlices; i <= halfSlices; i++) for (int i = -halfSlices; i <= halfSlices; i++)
{ {
if (i == 0)
{
rlColor3f(0.5f, 0.5f, 0.5f);
}
else
{
rlColor3f(0.75f, 0.75f, 0.75f);
}
rlVertex3f((float)i*spacing, 0.0f, (float)-halfSlices*spacing); rlVertex3f((float)i*spacing, 0.0f, (float)-halfSlices*spacing);
rlVertex3f((float)i*spacing, 0.0f, (float)halfSlices*spacing); rlVertex3f((float)i*spacing, 0.0f, (float)halfSlices*spacing);