Skip to content

Conversation

Jopestpe
Copy link
Contributor

@Jopestpe Jopestpe commented Oct 2, 2025

Description

  • Adds a basic recursive tree example with GUI controls, showing:
  • Recursive branching with adjustable angle, thickness, and decay
  • Optional Bezier-style branches
  • Real-time modification via GUI sliders and checkbox

Changelog

  • Added examples/shapes/shapes_recursive_tree.c - example code
  • Added examples/shapes/shapes_recursive_tree.png - screenshot
  • Updated Makefile, README.md, and examples_list.txt

Tested and compiles successfully on Linux
shapes_recursive_tree

float branchDecay = 0.66f;
bool bezier = false;

void Branch(Vector2 start, float length, float angle) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, could you format it with declaration/definition for function, similar to: https://github.com/raysan5/raylib/blob/master/examples/shapes/shapes_double_pendulum.c

Also, I'm not a big fan of recursion, is it possible to reimplement it in a more portable and self-contained function? Depending on globals and recursion is not portable... but if no possible to find another solution it's ok...

@raysan5 raysan5 changed the title ADDED: example: shapes_recursive_tree [examples] Add shapes_recursive_tree Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants