name of the OBJ file (as specified in the preload list)
parsed OBJ data with vertices (Float32Array), uvs (Float32Array), indices (Uint16Array), and vertexCount (number), or null if not found
// 1. preload the OBJ model and its texture
me.loader.preload([
{ name: "cube", type: "obj", src: "models/cube.obj" },
{ name: "cube", type: "image", src: "models/cube_texture.png" },
], () => {
// 2. create a Mesh using the preloaded model name
const mesh = new me.Mesh(400, 300, {
model: "cube", // references the preloaded OBJ
texture: "cube", // references the preloaded image
width: 200,
height: 200,
});
me.game.world.addChild(mesh);
// 3. or access the raw parsed data directly
const data = me.loader.getOBJ("cube");
// data.vertices — Float32Array of x,y,z positions
// data.uvs — Float32Array of u,v texture coordinates
// data.indices — Uint16Array of triangle vertex indices
// data.vertexCount — number of unique vertices
});
return the specified OBJ model data