如何从带有纹理的Blender中以json格式导出到Three.js? 如果我选中复选框“纹理”我的json文件不会加载到浏览器。 以下是我的材质与纹理复选框"materials": [{ "transparent": false, "DbgIndex": 0, "mapDiffuseRepeat": [1,1], "mapDiffuseAnisotropy": 1, "specularCoef": 50, "colorEmissive": [0,0,0], "colorDiffuse": [0.64,0.64,0.64], "wireframe": false, "visible": true, "blending": "NormalBlending", "DbgColor": 15658734, "mapDiffuse": "w.jpg", "DbgName": "Material.005", "opacity": 1, "depthWrite": true, "mapDiffuseWrap": ["RepeatWrapping","RepeatWrapping"], "depthTest": true, "shading": "phong", "colorSpecular": [0.5,0.5,0.5], "colorAmbient": [0.64,0.64,0.64] },...样子"materials": [{ "transparent": false, "DbgIndex": 0, "mapDiffuseRepeat": [1,1], "mapDiffuseAnisotropy": 1, "specularCoef": 50, "colorEmissive": [0,0,0], "colorDiffuse": [0.64,0.64,0.64], "wireframe": false, "visible": true, "blending": "NormalBlending", "DbgColor": 15658734, "mapDiffuse": "w.jpg", "DbgName": "Material.005", "opacity": 1, "depthWrite": true, "mapDiffuseWrap": ["RepeatWrapping","RepeatWrapping"], "depthTest": true, "shading": "phong", "colorSpecular": [0.5,0.5,0.5], "colorAmbient": [0.64,0.64,0.64] },...
如果我不这样做,它将不会加载纹理,但会加载对象,这是我的材料
"materials": [{ "blending": "NormalBlending", "specularCoef": 50, "colorEmissive": [0,0,0], "DbgName": "Material.005", "colorDiffuse": [0.64,0.64,0.64], "DbgIndex": 0, "opacity": 1, "colorSpecular": [0.5,0.5,0.5], "shading": "phong", "wireframe": false, "colorAmbient": [0.64,0.64,0.64], "depthTest": true, "transparent": false, "visible": true, "depthWrite": true, "DbgColor": 15658734 },...这是我的json装载机
loader.load('oddo.js', function(geometry, materials) { mesh = new THREE.Mesh(geometry, new THREE.MeshFaceMaterial(materials)); mesh.scale.x = x; mesh.scale.y = y; mesh.scale.z = z; mesh.opacity=1; var model = new THREE.Object3D(); model.add(mesh); model.position.set(0,0,0); //mesh.translation = THREE.GeometryUtils.center(geometry); group.add(model); });这是来自blender对象和导出器的图像
谢谢!
How can I export to Three.js with json format from Blender with Textures? If i check the checkbox "textures" my json file wont load to browser. Here is how my materials looks like with textures checkbox "materials": [{ "transparent": false, "DbgIndex": 0, "mapDiffuseRepeat": [1,1], "mapDiffuseAnisotropy": 1, "specularCoef": 50, "colorEmissive": [0,0,0], "colorDiffuse": [0.64,0.64,0.64], "wireframe": false, "visible": true, "blending": "NormalBlending", "DbgColor": 15658734, "mapDiffuse": "w.jpg", "DbgName": "Material.005", "opacity": 1, "depthWrite": true, "mapDiffuseWrap": ["RepeatWrapping","RepeatWrapping"], "depthTest": true, "shading": "phong", "colorSpecular": [0.5,0.5,0.5], "colorAmbient": [0.64,0.64,0.64] },...
If I don't it won't load textures but will load the object and here is my materials
"materials": [{ "blending": "NormalBlending", "specularCoef": 50, "colorEmissive": [0,0,0], "DbgName": "Material.005", "colorDiffuse": [0.64,0.64,0.64], "DbgIndex": 0, "opacity": 1, "colorSpecular": [0.5,0.5,0.5], "shading": "phong", "wireframe": false, "colorAmbient": [0.64,0.64,0.64], "depthTest": true, "transparent": false, "visible": true, "depthWrite": true, "DbgColor": 15658734 },...Here is my json loader
loader.load('oddo.js', function(geometry, materials) { mesh = new THREE.Mesh(geometry, new THREE.MeshFaceMaterial(materials)); mesh.scale.x = x; mesh.scale.y = y; mesh.scale.z = z; mesh.opacity=1; var model = new THREE.Object3D(); model.add(mesh); model.position.set(0,0,0); //mesh.translation = THREE.GeometryUtils.center(geometry); group.add(model); });and here is an image from blender object and exporter
Thank you!
最满意答案
致相关人士
我的解决方案是:
在搅拌机中将对象从“对象模式”转换为“编辑模式” 按“你” 选择“智能紫外线项目” 按确定 检查我图像中的选项To whom it may concern
The solution for me is:
In blender turn your object from "object mode" to "edit mode" Press "u" Select "Smart UV Project" Press ok Check the options in my image更多推荐
发布评论