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[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
level | number | A pyramid level. |
camera | TileCamera | 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 |
戻り値
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 }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。