How to map points on a line to points on a circle?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By redstonecreeper8

I’m making a space game where the surface of each planet is represented by a flat tilemap. When you leave the surface of the planet, the game transitions to a scene where the planet is represented by a circle, so that orbital mechanics work. What I want to know, is how can I make it so that the players x position on the flat tilemap matches up to an angle on the circlular planet. For example, if the player leaves at the far left end of the map and appears at the north pole, if they leave from the center of the map, they’ll appear at the south pole. I hope that made sense because my wording might have been really convoluted. Thanks!

This does not answer your question, but I developed a shader just a couple of weeks ago which might be useful for your project: Godot shader bending a flat 2d world (e.g. a platformer) to a tiny planet. · GitHub

Thomas Karcher | 2020-11-29 11:07