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[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
place | Vec3 | Where the model's middle goes, in the scene's units. |
axes | { x: Vec3; y: Vec3; z: Vec3; } | The satellite's axes ( |
scale | number | 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
]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。