xmcl-minecraft-launcher-core-node-model
v1.0.16-2
Published
Create Three.js model for player and block, Allow rotating player bodypart in model
Downloads
2
Maintainers
Readme
Model Module
This module can only used for browser environment
Usage
Rotating player body part with skin model
Use THREE.js rotateX, rotateY, rotateZ to rotate the mesh (body part) child under model
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