CesiumGS / obj2gltf

Convert OBJ assets to glTF
Apache License 2.0
1.71k stars 307 forks source link

ability to change up axis #63

Closed likangning93 closed 7 years ago

likangning93 commented 7 years ago

A lot of models going through obj2gltf right now come out sideways, since gltf assumes a Y-up axis. Does obj assume anything? Otherwise, should we add a flag for changing the up axis, along with some notes?

As observed by @mramato, it's probably also better to bake this transformation straight into the geometry by flipping components of vertices rather than slap a rotation quaternion onto the gltf scenegraph.

emackey commented 7 years ago

Blender's OBJ exporter offers user-selection of export axes, but the default is -Z forward, +Y up.

mramato commented 7 years ago

I believe Three,js loaders also assume Y up (or at least the obj loader does). So we should default to Y Up and let it be overridden by the caller.