cameraCentre関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The place the camera looks at for a moment: the home centre as it is (ground), the home centre as it was when the camera was set, carried west by the Earth's turn since (space), or the home centre read from the Sun's own place (sun: 0,0 is straight at noon).
It sets cameraSpin when the space camera has none yet. Pure apart from that.
インポート
import { cameraCentre } from "@johnmorrisdotca/chikyu-earth/realistic";
定義
function cameraCentre(model: Pick<EarthModel, "centre" | "camera" | "cameraSpin" | "time">): GeoPoint
引数
| 名前 | 型 | 説明 |
|---|---|---|
model | Pick<EarthModel, "time" | "centre" | "camera" | "cameraSpin"> | The model: its centre, camera, camera spin and the moment shown. |
戻り値
GeoPoint
The longitude and latitude the view is turned from (yaw and tilt are added to it by lookAt).
例
import { cameraCentre } from "@johnmorrisdotca/chikyu-earth/realistic";
const start = Date.UTC(2026, 10, 2, 12);
const model = { centre: { lon: 10, lat: 30 }, camera: "space" as const, cameraSpin: null, time: start };
cameraCentre(model);
model.time = start + 6 * 3_600_000;
console.log(cameraCentre(model).lon.toFixed(1));-80.2出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。