modelRadius関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The radius to draw a model at so that it is share of the height of the view across its radius, seen from away with the half field of view half (the tangent of half the field, as the view uses it): the model grows with the distance, so it reads
at any distance the camera keeps. Never under real, its true size, so a camera that comes in close still sees it as big as it is.
インポート
import { modelRadius } from "@johnmorrisdotca/chikyu-earth/space";
定義
function modelRadius(away: number, half: number, share: number, real: number): number
引数
| 名前 | 型 | 説明 |
|---|---|---|
away | number | The camera's distance from the satellite, in the scene's units. |
half | number | The tangent of half the field of view. |
share | number | The share of the view's height that the radius should take ( |
real | number | The model's true radius, in the same units. |
戻り値
number
The radius to draw it at.
例
import { MODEL_RADIUS_SHARE, modelRadius } from "@johnmorrisdotca/chikyu-earth/space";
console.log(modelRadius(0.5, Math.tan((35 / 2) * (Math.PI / 180)), MODEL_RADIUS_SHARE, 1e-8));0.0536007941094272出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。