本文へ移動

Chikyu Earth地球

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

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

目次

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

modelMatrix関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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 { modelMatrix } from "@johnmorrisdotca/chikyu-earth/space";

定義

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

引数

名前型説明
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.

戻り値

number[]

Sixteen numbers, row by row.

例

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
]

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

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

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