Skip to the content

Fuda Cards札

Collectible card frames for images and live 3D: a true thickness, an edge, foil, stacks, wear and a binder, as two web components.

Fuda is the Japanese word 札 for a card or a tag. About the name

Contents

Reference · Live 3D in cards

LiveItemtype

What a card shows in 3D: a key (items with the same key share their pictures) and a scene made from shared assets (assets.acquire).

Import it

import type { LiveItem } from "@johnmorrisdotca/fuda-cards/live-3d";

Definition

interface LiveItem<T extends ThreeLike = ThreeLike> {
    key: string;
    build(context: BuildContext<T>): LiveScene | Promise<LiveScene>;
}

Members

NameTypeDescription
keystring
build(context: BuildContext<T>): LiveScene | Promise<LiveScene>

Examples

import type { LiveItem } from "@johnmorrisdotca/fuda-cards/live-3d";
import { BoxGeometry, Mesh, MeshNormalMaterial, PerspectiveCamera, Scene } from "three";

const cube: LiveItem = {
  key: "cube",
  build() {
    const object = new Mesh(new BoxGeometry(1, 1, 1), new MeshNormalMaterial());
    return { scene: new Scene().add(object), camera: new PerspectiveCamera(40, 1, 0.1, 10), object };
  },
};
console.log(cube.key);

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/fuda-cards 0.11.0.