frameFor関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The nearest camera that holds the whole of min to max in a picture aspect wide for 1 tall, from angle.
インポート
import { frameFor } from "@johnmorrisdotca/uchusen-rockets";
定義
function frameFor(min: Vec3, max: Vec3, angle: Angle, aspect: number, margin?: number): Framing
引数
| 名前 | 型 | 説明 |
|---|---|---|
min | Vec3 | The lowest corner of the box to hold. |
max | Vec3 | The highest corner. |
angle | Angle | The angle to look from. |
aspect | number | The picture's width over its height. |
margin (省略可) | number | Room left round the box, as a multiple. Defaults to 1.08. |
戻り値
Framing
The camera that holds the whole box.
例
import { frameFor, VIEWS } from "@johnmorrisdotca/uchusen-rockets";
const framing = frameFor([-4.5, 0, -4.5], [4.5, 124, 4.5], VIEWS.front, 480 / 640);
console.log(framing.target, framing.distance.toFixed(0));[ 0, 62, 0 ] 321出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。