本文へ移動

Chikyu Earth地球

世界の国の輪郭を線で描いた地球儀です。地球と同じ速さで回ります。宇宙から見たような地球と、好きな場所の目印も使えます。

「地球」(ちきゅう) は、私たちが住む星の名前です。 名前について(英語)

目次

リファレンス · 太陽、月、惑星: 計算部分

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; }

引数

名前型説明
poseRidePose

The pose from ridePose for the camera at the satellite.

lookRideLook

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

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/chikyu-earth 0.51.1 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。