0
votes

I am using standard OBJLoader from Three.JS to import my .OBJ files. The problem is, that I get my model uploaded as single object, without children. I get whole geometry right and everything is ok, just, I would like to separate it by mesh. For example, I am importing a bed, and I would like to move only left side of the bed, or one mesh from the bed.

Here is my file that I am uploading: Test file.obj

You can see that If you load it into Three.js, everything is fine, but it's one single object. But If you take a look a the .OBJ file I have meshes separated (example: g akrMesh_65_65, g akrMesh_66_66 ). How can I load my .OBJ file so that I have object separated by meshes?

2

2 Answers

3
votes

The current version of ObjLoader does not recognize groups.

Here is what you need to do:

  1. Have a look at ObjLoader.js so you will understand why it is not working as you would like.

  2. See http://github.com/mrdoob/three.js/issues/2898 for a bit of history on this topic.

  3. As mentioned in that thread, http://Clara.io has the ability to import OBJ files and export three.js JSON scenes. That may be a work-around for you.

three.js r.65

1
votes

Open your obj file in Blender or some other program (@WestLangley mentioned Clara.io which looks cool) edit it (delete medshes you don't want there) and export to three.js JSON format.