Place a rainbow in the sky from the sun's height, and know when it cannot show
After the storm in a story, a rainbow is the sign that it is over, but a bow painted at a fixed spot looks wrong the moment the player turns or the sun is high. Real bows have a fixed size, sit opposite the sun and cannot appear at noon. Here is how to place one correctly, including the faint second bow.
Why this works
A rainbow is not a thing in the sky but a ring of fixed size around the spot opposite the sun. So its place follows from where the sun is, and the higher the sun climbs, the more of the ring sinks below the horizon.
When not to use it
Don't use it in a fantasy world where the rainbow is a landmark, a bridge or a goal that stays put. A real one moves with the viewer and can't be walked to, so place that one as a normal object.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 32 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Place a rainbow in the sky from the sun's height, and know when it cannot show" (read_entry rainbow-position-from-the-sun-height) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP