createLiveCards関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Make the live cards of a page. Nothing 3D is loaded until a card is first in focus (or a card with no picture of its own comes near the view and needs its still made).
インポート
import { createLiveCards } from "@johnmorrisdotca/fuda-cards/live-3d";
定義
function createLiveCards<T extends ThreeLike = ThreeLike>(options: LiveCardsOptions<T>): LiveCards<T>
引数
| 名前 | 型 | 説明 |
|---|---|---|
options | LiveCardsOptions<T> | How to load three.js ( |
戻り値
LiveCards<T>
The live cards; call add for each card, and dispose when the page is done with them.
例
import { createLiveCards } from "@johnmorrisdotca/fuda-cards/live-3d";
import { PerspectiveCamera, Scene } from "three";
const live = createLiveCards({ load: () => import("three") });
const card = document.querySelector("fuda-card") as HTMLElement;
const remove = live.add(card, {
key: "cube",
build: () => ({ scene: new Scene(), camera: new PerspectiveCamera(40, 1, 0.1, 10) }),
});
remove();この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。