LiveScene型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A scene for a card: kazoku-ui's scene, with object, the thing that turns about its upright axis while the card is in focus.
インポート
import type { LiveScene } from "@johnmorrisdotca/fuda-cards/live-3d";
定義
interface LiveScene extends Scene3D {
object?: {
rotation: {
y: number;
};
};
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
object (省略可) | { rotation: { y: number; }; } | undefined | |
scene | unknown | |
camera | unknown | |
update (省略可) | ((dt: number, now: number) => boolean | void) | undefined | Called before each draw while the view is live. Return true while something is moving; the view is then drawn again next frame, else it rests. |
resize (省略可) | ((width: number, height: number) => void) | undefined | The view's size in CSS pixels changed (set the camera's aspect). |
dispose (省略可) | (() => void) | undefined | Free what only this scene owns. Shared assets are freed by the cache. |
例
import type { LiveScene } from "@johnmorrisdotca/fuda-cards/live-3d";
import { BoxGeometry, Mesh, MeshNormalMaterial, PerspectiveCamera, Scene } from "three";
const cube = new Mesh(new BoxGeometry(1, 1, 1), new MeshNormalMaterial());
const scene = new Scene().add(cube);
const live: LiveScene = { scene, camera: new PerspectiveCamera(40, 1, 0.1, 10), object: cube };
console.log(live.object === cube);この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。