Skip to the content

Chikyu Earth地球

A line-drawn globe of the world's countries that turns at the Earth's own rate, with an optional realistic Earth from space and markers for any place.

Chikyu is the Japanese word 地球 for the Earth. About the name

Contents

Reference

The realistic Earth's pure parts

import { … } from "@johnmorrisdotca/chikyu-earth/realistic";

Exports

NameKindWhat it is
ATMOSPHERE_OUTERconstantThe glow reaches this many radii from the centre; the globe at 1x is drawn to fit inside it.
chooseTierfunctionThe width to hold for a layer when the globe's disc has radius radiusPx device pixels: the smallest shipped width that gives TEXELS_PER_RADIUS_PIXEL texels per pixel, else the largest, never more than cap, never less than the smallest.
createGatefunctionA rate gate for the draw: asks that come faster than minMs apart become one, and the last ask is never lost, so a burst of changes costs one draw.
discRadiusfunctionThe disc's radius in CSS pixels in a box of width x height at zoom: it fits the glow in the box at 1x.
frameCapfunctionThe frame rate cap for this device: maxFps (30 by default), lower on a small device.
GatetypeA rate gate for the draw: what createGate returns.
julianDayfunctionJulian day number of a moment in milliseconds since the Unix epoch.
LayertypeOne of the pictures the realistic Earth and the space view draw with: day, night, clouds, water and moon.
LightModetypeHow the Earth is lit: sun (the true light, with the night side dark and the city lights on it), lit (always lit, as if by daylight from the camera's side, the day picture and no city lights: the night side is never a black frame) or boost (the true terminator, with the night side raised so the land and coasts read).
lookAtfunctionWhere the view is centred on the globe: the home centre, turned by yaw (west) and tipped by tilt (south), held to the poles; a drag right is yaw and a drag up is tilt, and the ground follows the pointer.
MAX_TEXTUREconstantThe most pixels across a texture the package ever asks the GPU for.
subsolarPointfunctionThe point where the Sun is at the zenith at ms: latitude is the Sun's declination, longitude runs west at 15 degrees an hour.
TEXELS_PER_RADIUS_PIXELconstantTexels across the whole circumference wanted per device pixel of the globe's radius: 3 is a little under 2 pi, so a texel is a little larger than a pixel.
textureBytesfunctionBytes of GPU memory a texture of this width costs, with its mipmaps, at 4 bytes a pixel (the most it can be).
textureCapfunctionThe cap for this device: low-memory phones stop at 2048, and the GPU's own limit and the option are never passed.
ThreePartstypeThe parts of three.js the Earth and the space view use.
TIERSconstantThe widths each layer is shipped in (every picture is 2:1, so the height is half).
unitVectorfunctionA point on the globe as a unit vector: +z is longitude 0 on the equator, +x east, +y north.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/chikyu-earth 0.11.0.