Procedural Road Generation with zero assets in Custom C++ Game Engine
Using google mediapipe to get hand landmarks ratio & mapping them to End Effector Rate Control
The road generation system in CityGenerator.cpp employs a recursive binary space partitioning (BSP) algorithm to create a structured, Manhattan-style street network. It initializes the city grid by establishing two primary arterial roads that intersect at the map's center, dividing the area into four quadrants. The system then recursively subdivides these blocks: if a block exceeds a minimum size threshold, it is split either horizontally or vertically at a random point, and a new secondary road is laid along the division line. This process continues until the blocks reach a target density, ensuring a connected hierarchy of streets. During the mesh generation phase, the system iterates through the grid, identifying road cells and analyzing their immediate neighbors (top, bottom, left, right) to classify each segment as a straight road, corner, T-junction, or four-way intersection. This neighbor-aware context allows for the construction of appropriate geometry and the potential application of specific texture coordinates, ensuring that intersections and turns are visually coherent within the 3D environment
Full setup, prerequisites, usage steps, and troubleshooting: GitHub project page