Why is this object facing the wrong way when exporting to three.js? I'm working on a small project using the library three.js

We're using a plugin for Blender which allows us to export the model as a .json file, however the problem I am having is that when I export it and load it into the project, it's facing the wrong direction.

I've gone over the code and I'm sure it's not a coding error because


I have the green line, (y), the red line (x) and a blue line (z), z can't be seen because we're facing directly down at the camera.

In Blender, the model looks as such:


I am certain the error isn't from the coding side but an issue with the exporter add on which I found here: github.com/mrdoob/three.js/tree/master/utils/exporters/blender

So I think I am more or less looking for a solution to fix the importer, it seems to be written in python, I am still searching around for a solution for this but not yet come across one, hoping someone else has had this issue.
Nothing's necessarily wrong, your object just isn't going to be in the same position in ThreeJS as in Blender because the default orientation of the axes is different.

Now, the export system takes care of this. I suspect that your object rotated to make up the difference perfectly, and that the problem is in fact your camera! The same values will cause a different rotation in ThreeJS than in Blender.

You could go to the trouble of manually adjusting to your camera to compensate, but fortunately that isn't necessary. Blender and ThreeJS both have built-in "lookat" functions (here and here, respectively), so you can just export another object to orient them to accordingly (though Blender looks at the entire object while ThreeJS focuses on a single vertex, so make sure the object you use is a small one if you want precision!).