Loading...
Loading...
Use before repeatedly placing GLB models in PlayCanvas Engine, React, or Web Components to measure each asset once and record its uniform scale, grounding offset, and yaw correction in a stable nested transform.
npx skill4agent add playcanvas/skills calibrate-modelinspect-glbdimsgroundOffsetboundsSource: verticesconst ASSET_TUNING = {
model: {
boundsSource: 'vertices',
aabb: { min: [-4, -1, -9], max: [4, 6, 9] },
dims: [8, 7, 18],
center: [0, 2.5, 0],
groundOffset: 1,
intended: { dimension: 'length', size: 18 },
scale: 0.9,
y: 0.9,
yaw: 180
}
} as const;scale = intendedSize / measuredDimensiony = groundOffset * scaleapply-conventionsboundsSourceaabbdimscentergroundOffset{ scale, y, yaw }const yaw = new Entity('yaw');
yaw.setLocalEulerAngles(0, t.yaw, 0);
const visual = instantiate(asset);
visual.setLocalScale(t.scale, t.scale, t.scale);
visual.setLocalPosition(-t.center[0] * t.scale, t.y, -t.center[2] * t.scale);
yaw.addChild(visual);
root.addChild(yaw);y