zmbx2gltf 中文文档教程
zmbx2gltf
一个工具和库,用于将 MecaBricks .zmbx 文件转换为 GlTF
Node.js 使用
import { convertZmbxToGltf } from "zmbx2gltf";
import { readFile, writeFile } from "fs/promises";
async function main() {
const inputFile = await readFile("input.zmbx");
const gltf = await convertZmbxToGltf(inputFile);
await writeFile("output.gltf", JSON.stringify(gltf));
}
CLI 使用
zmbx2gltf <input.zmbx> <output.gltf>
浏览器使用
全局 convertZmbxToGltf
和 convertMbxToGltf
函数。 它们是全球性的,因为我不会被打扰。
zmbx2gltf
a tool and a library to convert MecaBricks .zmbx files to GlTF
Node.js usage
import { convertZmbxToGltf } from "zmbx2gltf";
import { readFile, writeFile } from "fs/promises";
async function main() {
const inputFile = await readFile("input.zmbx");
const gltf = await convertZmbxToGltf(inputFile);
await writeFile("output.gltf", JSON.stringify(gltf));
}
CLI usage
zmbx2gltf <input.zmbx> <output.gltf>
Browser usage
Global convertZmbxToGltf
and convertMbxToGltf
functions. They're global because I couldn't be bothered.