Reputation: 41
I have a scene in 3ds Max that I want to export in threejs. The problem is that the textures don't seem to appear in threejs and objects are deformed.
That's my workflow (I'm new to threejs so there must be some wrong steps):
Export from 3ds Max into .obj + .mtl (the objects are simple meshes and the materials are standard ones)
Import into Blender 2.66 for using io_mesh_threejs to convert the scene into JavaScript(since I wasn't able to find a suitable converter for 3ds Max).
After exporting it I was unable to see my scene in threejs but if I export it without materials it's OK.
Also I have found out that the coordinate system is different which results in unpredictable scene placement and interactivity.
I'm wondering if you have any suggestions on how to export my scene into JavaScript directly from 3ds Max?
Upvotes: 4
Views: 21739
Reputation: 3514
Use "ThreeJSExporter" script, actually, just copy the script code and run the script inside 3dsMax (the code https://github.com/timoxley/threejs/blob/master/utils/exporters/max/ThreeJSExporter.ms) since there is possibility to run .ms files there without any installations or command lines. Then you will get .js file (json), check that file manually to be sure to avoid the character like "#" in the arrays (I spent a lot of hours while found this source of errors), these values are generated sometimes while the script recalculated the data, I changed these values by numbers (the occurrences of "#" are not necessary to change in the strings :-)), and then just use loaders of THREE.js.
Here is the code:
var loader = new THREE.JSONLoader();
loader.load( 'js/file.js', function ( geometry ) {
var mesh = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial({color: 0x07624a}) );
mesh.position.x =0;
mesh.position.y =0;
mesh.position.z =0;
scene.add( mesh );
});
Here it is in the scene of WebGL Render. Between, I found that OBJLoader is recommended instead of JSONLoader but JSONLoader worked for me much better with THREE.js r71.
Source for similar approach: http://bkcore.com/blog/3d/webgl-three-js-workflow-tips.html
Upvotes: 0
Reputation: 133
You can use A3dsViewer to export 3ds models into the three.js and directly preview the result in the browser.
Upvotes: 2