A Minecraft Bedrock Edition script that loads and renders 3D OBJ models as debug lines in the world using the @minecraft/debug-utilities API.
- Loads OBJ model data (vertices and faces) from a string.
- Renders the model as wireframe using debug lines.
- Supports adjustable scale, fill density, and lighting direction.
- Automatically starts rendering when a player spawns.
- Place your OBJ model as a string export in
scripts/obj/. - Import and use the model in
scripts/index.js:
import { model } from "./obj/model.js";- You can then load a model like this
const loadedModel = loadOBJ(model);
system.runJob(renderOBJ(loadedModel, { x: 0, y: 200, z: 0 }, 1, 1, { x: 0, y: 400, z: 0 }));import { model } from "./obj/cat.js";
// other code
const loadedModel = loadOBJ(model);
system.runJob(renderOBJ(loadedModel, { x: 0, y: 200, z: 0 }, 0.1, 8));- Add an animation engine
- Add support for vertex colors and per-face coloring
- Support for loading MTL (material) files for color
