我是Three.js的新手,我需要建议。从Blender(版本2.71)导出模型并加载到场景后,我看到我的三个侧面有一个纹理.....但第二面没有纹理.....我必须启用双面纹理,但我不知道怎么样。我尝试了一些例子,但没有任何作用。我使用.PNG纹理格式与alpha-chanel ..我也尝试在Blender激活双方,但没有任何事情发生。
这是我的加载代码:
var three1;
var jsonLoader = new THREE.JSONLoader();
jsonLoader.load('3D/three1.js', addthree1ToScene);
function addthree1ToScene( geometry, materials )
{
var materiall = new THREE.MeshFaceMaterial( materials );
three1 = new THREE.Mesh( geometry, materiall );
three1.scale.set( 0.8, 0.8, 0.8 );
three1.position.set(50,15.5,0);
scene.add( three1 );
}
感谢您的任何建议! (抱歉我的英文:))
更新
..这样的东西?..
var three1;
var jsonLoader = new THREE.JSONLoader();
jsonLoader.load('3D/three1.js', addthree1ToScene);
function addthree1ToScene( geometry, materials )
{
var materiall = new THREE.MeshFaceMaterial( materials );
for ( var i = 0; i < materials.length; i ++ )
{
var material = materials[i];
material.side = THREE.DoubleSide;
}
three1 = new THREE.Mesh( geometry, materiall );
three1.scale.set( 0.8, 0.8, 0.8 );
three1.position.set(50,15.5,0);
scene.add( three1 );
}
有效,顺便说一下:)
答案 0 :(得分:1)
对于材质数组中的每种材质,请设置
material.side = THREE.DoubleSide;
three.js r.68