aboveModelShare関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The share of the view's height that a model's radius takes when the camera is distanceKm above the satellite (a ride above it). A satellite is a few metres across, so the model is drawn larger than it is, but a
model that stays a share of the picture at any height becomes a block thousands of kilometres across from far up. So the model keeps a fixed size in the world, about 16 km in radius, which is the share ABOVE_MODEL_SHARE
at ABOVE_MODEL_KM: it is never larger than that, falls as one over the height above it, and from MODEL_FADE_FROM_KM is let down smoothly (a smooth step) to nothing at MODEL_FADE_TO_KM, where the satellite is its ordinary mark.
Pure, so a test can ask it at any height.
インポート
import { aboveModelShare } from "@johnmorrisdotca/chikyu-earth/space";
定義
function aboveModelShare(distanceKm: number, lowest?: number): number
引数
| 名前 | 型 | 説明 |
|---|---|---|
distanceKm | number | The camera's distance from the satellite, in kilometres. |
lowest (省略可) | number | The share at the lowest height, |
戻り値
number
The share, from 0 to 0.17.
例
import { aboveModelShare } from "@johnmorrisdotca/chikyu-earth/space";
console.log(aboveModelShare(150), aboveModelShare(1000) < aboveModelShare(150), aboveModelShare(6000));0.17 true 0出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。