【问题标题】:Export from Blender to Three js with Textures从 Blender 导出到三个带有纹理的 js
【发布时间】:2016-02-27 09:40:00
【问题描述】:

如何从 Blender with Textures 以 json 格式导出到 Three.js?如果我选中“纹理”复选框,我的 json 文件将不会加载到浏览器。这是我的材质在纹理中的样子 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] },...

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

"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

谢谢!

【问题讨论】:

    标签: javascript json three.js blender


    【解决方案1】:

    它可能与谁有关

    我的解决方案是:

    1. 在搅拌机中将您的对象从“对象模式”转换为“编辑模式”
    2. 按“u”
    3. 选择“智能紫外线项目”
    4. 按确定
    5. 检查我图片中的选项

    【讨论】:

      【解决方案2】:

      我认为@Iraklis-Bekiaris 建议您不要布置 UV。如果是这样的话,也许这个视频会有所帮助。 https://www.youtube.com/watch?v=kDAxLvtpH0Y

      不过,我认为您的纹理可能没有正确链接。 w.jpg 是你的漫反射贴图。您需要确保 w.jpg 的副本位于您启动 HTML 页面的同一目录中。

      检查页面上是否有任何错误的一种方法是检查您的控制台。在 Chrome 中加载您的 HTML 页面。如果您无法右键单击页面和“检查元素”,(有时三个禁用右键单击),您应该可以从菜单栏中选择“视图”>“开发者”>“Javascript 控制台”。

      希望对您有所帮助!

      【讨论】:

        猜你喜欢
        • 2018-12-23
        • 1970-01-01
        • 2018-10-16
        • 2015-01-11
        • 2014-09-12
        • 1970-01-01
        • 2013-12-08
        • 2016-02-27
        • 2015-06-07
        相关资源
        最近更新 更多