Reference · The Sun, Moon and planets: pure parts
outsidePosefunction
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 it
import { outsidePose } from "@johnmorrisdotca/chikyu-earth/space";
Definition
function outsidePose(pose: RidePose, look: RideLook, low?: number): { pose: RidePose; distance: number; below: number; }
Parameters
| Name | Type | Description |
|---|---|---|
pose | RidePose | The pose from |
look | RideLook | The look the pose was made with. |
low (optional) | 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. |
Returns
{ 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.
Examples
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.0021What it prints (run when this page was built)