How to fix the orientation and pivot of an AI-generated model
A generated model often faces the wrong way, lies on its side or spins around a point in empty space. Turn it upright, face its front toward +Z for glTF, apply the rotation, and move the origin to the center of its base. Godot, Unity, three.js and Roblox Studio use +Y as up. Unreal Engine uses +Z as up, and its importer converts a +Y-up GLB for you.

Why generated models face the wrong way
Generators orient the mesh to match the input image or their own camera, not your engine, so the front can point down any axis.
They also leave the origin at the center of the bounding box. Placed at 0, 0, 0, the model sinks halfway through the floor and rotates around its middle.
Fix the orientation and pivot by hand
- Import the GLB into your 3D editor and look at it from the front view.
- If the model lies on its side, rotate it 90 degrees on X until its top points up.
- Rotate it around the up axis until its front faces the front view. glTF expects the front to face +Z.
- Apply the rotation so the transform reads 0, 0, 0.
- Set the origin to the center of the bottom of the bounding box, then move the model so that point sits at 0, 0, 0.
- Export a GLB with +Y up. For Unreal Engine, let the importer convert the axes instead of rotating the mesh by hand.
meshfx sets the origin and faces the model down the axis you name in the same compile that lightens it.
Use with your agent
Paste the prompt into Claude Code, Cursor or Codex. Your agent connects to Spatial Compiler and comes back with a GLB with the origin where you asked and a report of where it sits.
New accounts start with $5 of usage, and you see the price of each job before it runs.
Connect the Spatial Compiler MCP server at https://spatialcompiler.dev/mcp if it isn't connected yet. Use meshfx to stand my generated model upright facing +Z, move its origin to the center of its base. Run a Draft first. Your first 50 mesh Drafts are free with the $5 signup credit. Ask before running a final compile.
Or add the server yourself in Claude Code:
claude mcp add --transport http spatial-compiler https://spatialcompiler.dev/mcp
Generated model orientation questions
Why does my generated model face the wrong way?
Generators orient the mesh to the input image or their own camera, not to your engine. glTF expects +Y up with the front facing +Z, so turn the model to match and apply the rotation.
Where should the pivot of a game model be?
For props and characters, put the origin at the center of the base, so the model sits on the floor at 0, 0, 0. Doors and levers pivot at their hinge instead.
Do I need to rotate a GLB for Unreal Engine?
No. Unreal Engine uses +Z as up, and its glTF importer converts a +Y-up GLB for you. Rotating the mesh by hand as well turns it on its side.


