Looking for help exporting an OBJ file

We have a three.js animation that’s been built here https://cryptoart.surge.sh/

We need to export it to OBJ, but using the default three.js exporter, the image just comes out as a gray square, with no sub squares and colours.

Please reach out to lewis@dangerfarms.com if you believe you can solve this.

How do you export the OBJ to an image?

Are you using toDataURL ?

renderer.domElement.toDataURL();

We’re currently using three.js/OBJExporter.js at 1a241ef10048770d56e06d6cd6a64c76cc720f95 · mrdoob/three.js · GitHub

But the object that is output is a gray cube – we need the textures, colours, and detail to be preserved.

What type of “Image” you get ? (.jpg, .png)

Are you sure its an Image and not a 3D File?

Because if i see correct the exporter you mentioned can’t export to Images. It just can export a scene back to OBJ.

The OBJ file format requires a .mtl file to preserve the materials, is this file being exported with your obj file?

Hi there,

No, I am not exporting an MTL file. Do you know how I would do such a thing?

The code exists here: https://github.com/dangerfarms/cryptoart-cube/blob/0cb3a3b50ea66b6a762ca6f83ae498fec2182717/src/components/react/CubeRenderer.js#L84

Is there a reason you need to preserve the OBJ format? Best recommended solution would be to export to a format with materials embedded such as glb or fbx depending on the use case, there are existing exporters for these formats, I’m not sure there’s a mtl exporter included in the library and unfamiliar with .OBJ format workflow in THREE.js

There is no reason for OBJ – FBX would definitely work, I just couldn’t see examples of where or how to do it in Javascript.

Any help appreciated.

OK great, if you’re using es6 modules, the only real way you can go is to use the gltf exporter and open with blender

Hey,

Unfortunately it doesn’t seem to work. Would someone be able to help over a video chat or other? I feel my knowledge is not good enough :frowning:

Best wishes,
Lewis

This topic was automatically closed after 30 days. New replies are no longer allowed.