Craig Bradley
Craig Bradley

Reputation: 63

XCode Scene view loading model incorrectly

I've loaded a model into my scene (.scn) and when zero-ing the model out, it seems to be at a 90 degree angle on the x-axis (even though the inspector says 0).

enter image description here

This is incorrect, but strangely when the running the scene on the emulator the model loads in the correct position.

enter image description here Has anyone experienced this before? It's rather annoying.

Upvotes: 1

Views: 213

Answers (1)

Pro Blaster
Pro Blaster

Reputation: 491

Yes! This is a common thing to experience.

Depending on where you made your model, blender, sketchup, 3dsmax, etc. Some programs use a "Y-up Axis" that means that the Y axis is up. However, SceneKit uses a "Z-up Axis".

The reason it appears differently when running your app is because in your ".xcaccets" folder, or whatever it is called, you have "always convert to z-up axis" checked.

I'm not quite sure how to convert it before editing in Xcode's editor, but perhaps, you could use write(to:options:delegate:progressHandler:) to export the corrected version out of SceneKit for non-eye-sore Z-up editing.

Hope This helps!

Upvotes: 4

Related Questions