From 5495552db56ddcfecd805ca7d20fe81f45d3e677 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Wed, 26 Jul 2023 00:09:47 +0900 Subject: [PATCH] yet another sky model changes --- src/net/torvald/parametricsky/Application.kt | 3 ++- src/net/torvald/terrarum/modulebasegame/clut/Skybox.kt | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/net/torvald/parametricsky/Application.kt b/src/net/torvald/parametricsky/Application.kt index c399c38db..77a72359b 100644 --- a/src/net/torvald/parametricsky/Application.kt +++ b/src/net/torvald/parametricsky/Application.kt @@ -185,7 +185,8 @@ class Application(val WIDTH: Int, val HEIGHT: Int) : Game() { val theta = sqrt(xf*xf + yf*yf) * HALF_PI*/ // AM-PM mapping (use with WIDTH=1) - val yf = (y * 2.0 / oneScreen.height) % 1.0 + var yf = (y * 2.0 / oneScreen.height) % 1.0 + if (elevation < 0) yf -= (elevation / HALF_PI) val gamma = if (y < halfHeight) HALF_PI else 3 * HALF_PI val theta = yf.mapCircle() * HALF_PI diff --git a/src/net/torvald/terrarum/modulebasegame/clut/Skybox.kt b/src/net/torvald/terrarum/modulebasegame/clut/Skybox.kt index 2dfaf502c..03422a468 100644 --- a/src/net/torvald/terrarum/modulebasegame/clut/Skybox.kt +++ b/src/net/torvald/terrarum/modulebasegame/clut/Skybox.kt @@ -103,7 +103,9 @@ object Skybox : Disposable { // printdbg(this, "elev $elevationDeg turb $turbidity") for (y in 0 until gradSize) { - val theta = (y.toDouble() / gradSize * 1.0).coerceIn(0.0, 1.0).mapCircle() * HALF_PI + var yf = (y.toDouble() / gradSize * 1.0).coerceIn(0.0, 1.0) + if (elevationDeg < 0) yf += (elevationDeg / 90.0) + val theta = yf.mapCircle() * HALF_PI // vertical angle, where 0 is zenith, ±90 is ground (which is odd) val xyz = CIEXYZ(