使用纹理从Blender导出到三个js(Export from Blender to Three js with Textures)

编程入门 行业动态 更新时间:2024-10-21 17:30:16
使用纹理从Blender导出到三个js(Export from Blender to Three js with Textures)

如何从带有纹理的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

更多推荐

本文发布于:2023-08-06 18:42:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1453829.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:纹理   导出到   Blender   Textures   js

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!