outsidePose関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The camera of an outside ride: the pose ridePose works out for a camera at the satellite, moved to OUTSIDE_KM back along its own line of sight so the satellite is in front of it. Looking along the way it goes (look: "horizon") the satellite sits a little below the middle of the picture, so the camera is behind and above it; looking
down (look: "down") it is at the middle, with the camera straight above it. Where the satellite sits in the picture does not change with the zoom. Which way the camera looks and which way is up are the pose's own, so the look-around is the same as from the satellite itself; the camera goes round the satellite as it looks about. Pure. Never nearer the ground than half the satellite's height.
インポート
import { outsidePose } from "@johnmorrisdotca/chikyu-earth/space";
定義
function outsidePose(pose: RidePose, look: RideLook, low?: number): { pose: RidePose; distance: number; below: number; }
引数
| 名前 | 型 | 説明 |
|---|---|---|
pose | RidePose | The pose from |
look | RideLook | The look the pose was made with. |
low (省略可) | number | undefined | How far below the middle of the picture the satellite is, as a share of half its height (0 the middle, 1 the bottom edge); by default 0.8 looking along and 0 looking down. |
戻り値
{ pose: RidePose; distance: number; below: number; }
The pose moved back from the satellite, with how far the camera is from it in Earth radii and how many degrees below the middle of the picture the satellite is.
例
import { outsidePose, ridePose } from "@johnmorrisdotca/chikyu-earth/space";
const at = ridePose({ position: [1.066, 0, 0], velocity: [0, 0, -7.66], look: "horizon", yaw: 0, tilt: 0, zoom: 1 });
const out = outsidePose(at, "horizon");
console.log(out.distance.toFixed(4), out.below.toFixed(1), out.pose.position.map((n) => n.toFixed(4)).join(","));0.0039 24.8 1.0693,0.0000,0.0021出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。