gpt4 book ai didi

javascript - 从 Blender 导出到三个带有纹理的 js

转载 作者:行者123 更新时间:2023-11-29 14:45:06 25 4
gpt4 key购买 nike

如何从 Blender with Textures 以 json 格式导出到 Three.js?如果我选中“纹理”复选框,我的 json 文件将不会加载到浏览器。这是我的 Material 与纹理复选框的样子
“ Material ”: [{
“透明”:假的,
“数据库索引”:0,
“mapDiffuseRepeat”:[1,1],
“mapDiffuseAnisotropy”:1,
“高光系数”:50,
“颜色发射”:[0,0,0],
“colorDiffuse”:[0.64,0.64,0.64],
“线框”:假的,
“可见”:真实,
“混合”:“正常混合”,
“DbgColor”:15658734,
"mapDiffuse": "w.jpg",
"DbgName": "Material.005",
“不透明度”:1,
“深度写入”:真实的,
“mapDiffuseWrap”:[“RepeatWrapping”,“RepeatWrapping”],
“深度测试”:真实的,
“阴影”:“冯”,
“高光色”:[0.5,0.5,0.5],
“colorAmbient”:[0.64,0.64,0.64]
},...

如果我不这样做,它不会加载纹理但会加载对象,这是我的 Material

"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);
});

and here is an image from blender object and exporter

谢谢!

最佳答案

与谁有关

我的解决方案是:

  1. 在 blender 中将你的对象从“对象模式”切换到“编辑模式”
  2. 按“你”
  3. 选择“智能紫外线项目”
  4. 按确定
  5. 检查我图像中的选项

关于javascript - 从 Blender 导出到三个带有纹理的 js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33902273/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com