我有平面几何方形,并且在点光源下从Blender导出相同的方形,并且PlangeGeometry表现得很奇怪 - 当点光变得接近正方形中心时,方形变得更暗。模型方块不会发生这种情况。
这是我的几何材质设置:
var map = THREE.ImageUtils.loadTexture( "dirt.png");
map.wrapS = map.wrapT = THREE.RepeatWrapping;
map.anisotropy = 16;
var material = new THREE.MeshLambertMaterial( { ambient: 0xbbbbbb, map: map, side: THREE.DoubleSide } );
var object = new THREE.Mesh( new THREE.PlaneGeometry( SQUARE_SIZE, SQUARE_SIZE, 1, 1 ), material );
这是我导入的模型js摘录:
"materials" : [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "dirt",
"blending" : "NormalBlending",
"colorAmbient" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorDiffuse" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorSpecular" : [0.5, 0.5, 0.5],
"depthTest" : true,
"depthWrite" : true,
"mapDiffuse" : "dirt.png",
"mapDiffuseWrap" : ["repeat", "repeat"],
"shading" : "Lambert",
"specularCoef" : 50,
"transparency" : 1.0,
"transparent" : false,
"vertexColors" : false
}],
我可以使平面几何体像导入模型一样工作吗?
答案 0 :(得分:0)
这种情况发生的原因在这里解释:Three.js: What Is The Exact Difference Between Lambert and Phong?。
您有两种选择:
MeshPhongMaterial
或增加几何体的细分如下:
new THREE.PlaneGeometry( SQUARE_SIZE, SQUARE_SIZE, 10, 10 );
第一个选择是更好的选择。
three.js r.66