JSPM

  • Created
  • Published
  • Downloads 113
  • Score
    100M100P100Q78115F
  • License MIT

Create Three.js model for player and block

Package Exports

  • @xmcl/model

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@xmcl/model) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Model Module

npm version Downloads Install size npm Build Status stability-experimental

This module can only used for browser environment

Usage

Build THREE.js model for block and player (PREVIEW, not available yet)

Please read how to use resource-manager before this

Create THREE.js block model:

    import { BlockModelFactory } from "@xmcl/model";

    const textureRegistry: TextureRegistry;

    const factory = new BlockModelFactory(textureRegistry);
    const model: BlockModel.Resolved;
    const o3d: THREE.Object3D = factory.getObject(model);
    // add o3d to your three scene

Create THREE.js player model:

    import { PlayerModel } from "@xmcl/model";

    const player: PlayerModel = new PlayerModel();
    const isSlimSkin: boolean; // if this skin use alex model
    player.setSkin("http://your-skin-url", isSlimSkin);

    const o3d: THREE.Object3D = player.playerObject3d;
    // add o3d to your three scene