---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://framesfield.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
title: "Fix Floating, Giant, or Off-Center AI 3D Models in Blender"
description: "Run a headless Blender Python normalization pass on every raw AI GLB to clear hidden parent transforms, scale uniformly to real-world metric height, snap the lowest vertex to Z = 0 with centered X/Y origin, apply all transforms, and re-export glTF 2.0 Y-Up."
canonical: "https://framesfield.com/fixes/ai-3d-glb-scale-origin-and-pivot-offset-blender-fix"
---

# Fix Floating, Giant, or Off-Center AI 3D Models in Blender

> Run a headless Blender Python normalization pass on every raw AI GLB to clear hidden parent transforms, scale uniformly to real-world metric height, snap the lowest vertex to Z = 0 with centered X/Y origin, apply all transforms, and re-export glTF 2.0 Y-Up.

- **Canonical URL:** https://framesfield.com/fixes/ai-3d-glb-scale-origin-and-pivot-offset-blender-fix
- **Category:** Visual & 3D Craft
- **Error Signature:** `Blender / Three.js inspection: bbox dimensions 2.00m × 2.00m × 2.00m for an 18cm bottle | min_y = -0.98m (sunk through floor) | Unapplied parent Empty scale (0.01, 0.01, 0.01) or 90-degree X rotation`
- **Last Verified:** 2026-12-01

## Observed Symptom

You import a Tripo 3D, Meshy 3D, Hyper3D Rodin, or Hunyuan3D 2 GLB mesh into Blender, Shopify AR, Three.js, or Google model-viewer, and the product spawns two meters tall, floats above or sinks halfway through the studio floor, faces sideways instead of forward, or orbits wildly off-center whenever users drag the turntable.

## Technical Root Cause

Image-to-3D networks normalize generated meshes into an arbitrary dimensionless cube (typically [-1, 1] or a 1-meter bounding sphere) centered on the geometric centroid rather than the real-world base contact plane—and export nested parent Empty wrappers with unapplied 90-degree axis rotations or 0.01 centimeter scale factors.

## Under the Hood

Physical 3D pipelines depend on strict real-world metric units and consistent coordinate axes: glTF 2.0, Three.js, Google model-viewer, and Apple AR Quick Look all define 1.0 unit as exactly 1.0 meter with +Y up and +Z facing the viewer, whereas Blender operates natively in meters with +Z up and -Y facing the front camera. AI 3D generators like Tripo 3D, Meshy 3D, Hyper3D Rodin, and Microsoft TRELLIS do not know whether a studio photo depicts a 14 cm perfume bottle, a 32 cm ceramic pour-over kettle, or a 90 cm lounge chair—so they normalize the raw reconstructed mesh to fill a canonical unit cube centered at (0, 0, 0).

Because the origin sits at the vertical center of that bounding box instead of the bottom base plane, half of the mesh immediately penetrates the shadow catcher floor at Z = 0 in Blender (or Y = 0 in WebGL). Worse, many raw API exports wrap the mesh inside a hidden root Empty node carrying a baked scale of 0.01 or a 90-degree X-axis transform. If an artist manually scales or moves the object in Blender Object Mode without unparenting with Keep Transform and running Apply All Transforms (Ctrl+A), the visual viewport looks fixed while the exported GLB retains broken node matrices that break Cycles depth-of-field, bevel modifiers, physics colliders, and mobile AR sizing.

The deterministic fix is to normalize every incoming AI GLB inside headless Blender before lighting, rigging, or web compression: clear parent wrappers while keeping world transforms, compute the evaluated world-space bounding box across all mesh vertices, apply a single uniform scale factor matching the product’s real physical height in meters, translate the mesh so X and Y centers sit at 0.0 and the lowest vertex rests exactly on Z = 0.0, apply Location/Rotation/Scale cleanly to (0, 0, 0) / (1, 1, 1), and export glTF 2.0 with Y-Up enabled.

## Before vs. After

### Broken (Broken Raw Import (Centroid Origin, Arbitrary 2m Unit Cube, Unapplied Scale))

```
# Raw Tripo / Meshy / Rodin GLB inspected before normalization:
Dimensions: X=1.42m, Y=1.42m, Z=2.00m  (Actual product is a 24cm bottle!)
World BBox: Z_min = -1.00m, Z_max = +1.00m  (Half sunk below floor!)
Parent Empty: scale=(0.01, 0.01, 0.01), rotation_x=90deg (unapplied)
```

### Verified Fix (Normalized Metric GLB (Exact 0.24m Height, Floor Z=0, Identity Transforms))

```
# After headless Blender normalization (target height = 0.24m):
Dimensions: X=0.170m, Y=0.170m, Z=0.240m  (Exact real-world meters)
World BBox: X=[-0.085, 0.085], Y=[-0.085, 0.085], Z=[0.000, 0.240]
Mesh Object: location=(0,0,0), rotation=(0,0,0), scale=(1,1,1), parent=None
```

Baking world transforms directly into mesh vertex coordinates with Z_min = 0.0 and identity node transforms guarantees identical floor contact, orbit pivot, and real-world AR sizing across Blender Cycles, Three.js, Shopify, and iOS Quick Look.

## Copy-Paste Fix (normalize-ai-glb-blender.sh)

```bash
#!/usr/bin/env bash
set -euo pipefail

# Usage: ./normalize-ai-glb-blender.sh raw_product.glb normalized_product.glb 0.24 [yaw_deg]
# Example: 0.24 = 24 cm real-world height; optional yaw_deg rotates facing direction (e.g. 90 or 180)
IN_GLB="${1:?Provide input raw .glb path}"
OUT_GLB="${2:?Provide output normalized .glb path}"
TARGET_HEIGHT_M="${3:-0.24}"
YAW_DEG="${4:-0}"

BLENDER_BIN="${BLENDER_BIN:-blender}"
SCRIPT_TMP="$(mktemp /tmp/normalize_glb_XXXXXX.py)"
trap 'rm -f "$SCRIPT_TMP"' EXIT

cat << 'PYEOF' > "$SCRIPT_TMP"
import sys
import math
import bpy
from mathutils import Vector, Matrix

argv = sys.argv[sys.argv.index("--") + 1:]
in_path, out_path = argv[0], argv[1]
target_h = float(argv[2])
yaw_deg = float(argv[3]) if len(argv) > 3 else 0.0

# 1. Start from a completely empty scene (removes default Cube, Camera, Light)
bpy.ops.wm.read_factory_settings(use_empty=True)
bpy.ops.import_scene.gltf(filepath=in_path)

meshes = [obj for obj in bpy.context.scene.objects if obj.type == 'MESH']
if not meshes:
    raise RuntimeError(f"No mesh objects found inside {in_path}")

# 2. Unparent every mesh keeping exact world matrix, then delete wrapper Empties
for obj in meshes:
    world_mat = obj.matrix_world.copy()
    obj.parent = None
    obj.matrix_world = world_mat

for obj in list(bpy.context.scene.objects):
    if obj.type != 'MESH':
        bpy.data.objects.remove(obj, do_unlink=True)

# 3. Optional front-facing yaw correction around Blender Z-up axis
if abs(yaw_deg) > 1e-4:
    rot = Matrix.Rotation(math.radians(yaw_deg), 4, 'Z')
    for obj in meshes:
        obj.matrix_world = rot @ obj.matrix_world

# 4. Bake all object transforms directly into mesh vertex data
bpy.ops.object.select_all(action='DESELECT')
for obj in meshes:
    obj.select_set(True)
bpy.context.view_layer.objects.active = meshes[0]
bpy.ops.object.transform_apply(location=True, rotation=True, scale=True)

# 5. Compute unified world bounding box across all mesh vertices
def world_bounds(objs):
    xs, ys, zs = [], [], []
    for o in objs:
        for corner in o.bound_box:
            wc = o.matrix_world @ Vector(corner)
            xs.append(wc.x); ys.append(wc.y); zs.append(wc.z)
    return min(xs), max(xs), min(ys), max(ys), min(zs), max(zs)

min_x, max_x, min_y, max_y, min_z, max_z = world_bounds(meshes)
cur_h = max_z - min_z
if cur_h <= 1e-6:
    raise RuntimeError("Degenerate mesh with zero height.")

# 6. Scale uniformly to exact target metric height, then snap bottom-center to (0, 0, 0)
scale_f = target_h / cur_h
for obj in meshes:
    obj.scale = (scale_f, scale_f, scale_f)
bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)

min_x, max_x, min_y, max_y, min_z, max_z = world_bounds(meshes)
offset = Vector((-(min_x + max_x) / 2.0, -(min_y + max_y) / 2.0, -min_z))
for obj in meshes:
    obj.location += offset
bpy.ops.object.transform_apply(location=True, rotation=True, scale=True)

# 7. Final verification report and clean Y-Up glTF 2.0 GLB export
f_min_x, f_max_x, f_min_y, f_max_y, f_min_z, f_max_z = world_bounds(meshes)
print(
    f"NORMALIZED_BBOX_METERS: "
    f"W={f_max_x - f_min_x:.4f} D={f_max_y - f_min_y:.4f} H={f_max_z - f_min_z:.4f} "
    f"Z_MIN={f_min_z:.4f}"
)

bpy.ops.export_scene.gltf(
    filepath=out_path,
    export_format='GLB',
    export_yup=True,
    export_apply=True,
)
PYEOF

"$BLENDER_BIN" --background --python "$SCRIPT_TMP" -- "$IN_GLB" "$OUT_GLB" "$TARGET_HEIGHT_M" "$YAW_DEG"
```

## Step-by-Step Resolution

1. **Measure the real product height in meters and inspect the raw GLB:** Check physical SKU specs (for example 240 mm = 0.24 m) and inspect the raw Tripo 3D, Meshy, or Rodin GLB with @gltf-transform/cli inspect to spot oversized 2.0 m boxes or negative Y floor offsets.
2. **Run the headless Blender normalization script to bake scale and floor pivot:** Execute normalize-ai-glb-blender.sh with your exact target height in meters (and optional yaw rotation such as 90 or 180 if the front label faces sideways). The script removes parent Empty wrappers, snaps Z_min to 0.000, and applies all transforms to identity.
3. **Compress textures after normalization and verify in gltf-transform and model-viewer:** Run @gltf-transform/cli optimize (--compress meshopt --texture-compress webp --texture-size 1024) on the normalized GLB so file size drops under 1.5 MB without altering the metric bounding box, then verify bboxMin Y equals 0.000.

## Verification Check (Inspect Exported glTF Bounding Box in Real-World Meters (Y-Up))

```bash
npx --yes @gltf-transform/cli inspect normalized_product.glb | grep -E "bboxMin|bboxMax|MESHES|name"
```

**Expected healthy output:**

```text
bboxMin: [-0.085, 0.000, -0.085]  |  bboxMax: [0.085, 0.240, 0.085]  # Y_min MUST equal 0.000 and Y_max MUST match target height in meters
```

## Prevention Guardrails

1. **Maintain a SKU physical dimensions JSON table for every 3D batch:** Pass real-world height_meters from your catalog spreadsheet straight into the headless Blender runner so AR Quick Look and Cycles lighting rigs match true physical scale automatically.
2. **Always apply transforms before adding Blender bevels, shaders, or physics:** Non-uniform or 0.01 residual scale on imported GLB meshes distorts Cycles bump height, shadow bias, bevel width, and rigid-body collisions.
3. **Lock front-elevation 2D studio inputs before generating 3D meshes:** Feeding clean front-facing orthographic images into Tripo 3D or Meshy produces predictable forward orientation and reduces manual yaw corrections.

## FAQs

### Why does Blender show Z_min = 0.000 while gltf-transform inspect reports Y_min = 0.000?

Blender uses a Z-up coordinate system whereas the glTF 2.0 specification (used by Three.js, model-viewer, and Shopify) mandates Y-up. Exporting with export_yup=True automatically maps Blender +Z to glTF +Y so the product rests cleanly on the WebGL ground plane.

### Can I fix pivot offset without installing Blender using gltf-transform CLI alone?

For quick web-only bottom-center pivot snapping without changing scale, npx @gltf-transform/cli center --pivot below raw.glb centered.glb works in two seconds. However, when you need exact real-world metric height scaling, yaw alignment, or removal of nested Empty scale nodes, headless Blender is far more deterministic.

### Why does my mug show up two meters tall inside iOS AR Quick Look even though it looks fine in Three.js?

Three.js and model-viewer auto-frame the camera to fit any bounding box, hiding scale errors on desktop screens. Apple AR Quick Look and Android Scene Viewer strictly interpret 1 glTF unit as 1 real-world meter, turning an unscaled 2.0-unit AI mesh into a giant 2-meter mug on the user’s table.

### Should I join multi-part AI GLB meshes into a single object during normalization?

Keep separate mesh parts intact if you plan to assign different materials (such as glass bottle plus metallic pump) or animate a lid opening in Blender. The script above transforms every mesh object cleanly around the shared world bounding box without merging separate material parts.

### What Blender binary path should macOS users set when running headless CLI scripts?

On macOS, pass BLENDER_BIN="/Applications/Blender.app/Contents/MacOS/Blender" before calling the script, or symlink it into /usr/local/bin/blender so both shell batch runners and Blender MCP sessions resolve the same executable.
