本文へ移動

Chikyu Earth地球

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

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

目次

リファレンス · リアルな地球の計算部分

tilesInView関数

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

The tiles of a level that are in view: those with a sampled point inside the box (a little over, so a tile slides in before its edge does), and those under a grid of points across the box. The antimeridian and the poles need nothing special: a tile is tested where it is on the sphere, and a longitude of 180 is the last column.

インポート

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

定義

function tilesInView(level: number, camera: TileCamera, sun?: readonly [number, number, number]): VisibleTile[]

引数

名前型説明
levelnumber

A pyramid level.

cameraTileCamera

The camera.

sun (省略可)readonly [number, number, number] | undefined

The Sun's direction as the camera sees it (+x right, +y up, +z toward the viewer), to read each tile's ndl; left out, ndl is 1.

戻り値

VisibleTile[]

The tiles in view, the nearest to the middle of the box first.

例

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

const tiles = tilesInView(4, { lon: 179.9, lat: 89, width: 800, height: 600, panX: 0, panY: 0, radius: 3000 });
console.log(tiles.length, tiles[0]);
48 { level: 4, col: 31, row: 0, d: 242.19606186369626, ndl: 1 }

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

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

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