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 Sun, Moon and planets: pure parts

modelMatrixfunction

The 4 by 4 matrix, row by row (what three.js's Matrix4.set takes), that puts a model of radius 1 at a place, turned to the satellite's axes and scaled: its columns are the axes times the scale, then the place.

Import it

import { modelMatrix } from "@johnmorrisdotca/chikyu-earth/space";

Definition

function modelMatrix(place: Vec3, axes: { x: Vec3; y: Vec3; z: Vec3; }, scale: number): number[]

Parameters

NameTypeDescription
placeVec3

Where the model's middle goes, in the scene's units.

axes{ x: Vec3; y: Vec3; z: Vec3; }

The satellite's axes (satelliteAxes).

scalenumber

The model's radius in the scene's units.

Returns

number[]

Sixteen numbers, row by row.

Examples

import { modelMatrix, satelliteAxes } from "@johnmorrisdotca/chikyu-earth/space";

const axes = satelliteAxes([1.066, 0, 0], [0, 0, -7.66])!;
console.log(modelMatrix([1.066, 0, 0], axes, 0.01));
[
      0,   -0, 0.01, 1.066,
      0, 0.01,    0,     0,
  -0.01,    0,    0,     0,
      0,    0,    0,     1
]

What it prints (run when this page was built)

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