Link
How It Works
The program first calculates the relative positions of each vertex based on the player's coordinates. It then applies rotation using trigonometric functions to transform the 3D coordinates.
The resulting 2D coordinates are temporarily stored in a list. Objects are then sorted by their distance from the camera before being drawn. This ensures that objects farther away are rendered behind closer objects, preventing distant objects from incorrectly appearing in front.