Can two materials be assigned to the same grid loaded by JSONLoader?
I made a simple symbol in a blender and exported it to three.js format, which contains morphing targets and UVs.
I tried to assign solid colored material to the body and picture of my character ( http://touhou.ru/dev/webgl-test-stackoverflow/kourindouhime.jpg ), but after loading the grid and materials I get a gray grid.
Here is the production version of my project (using wasd to move, and when you see the gray grid of players with which you will control, this is exactly what I'm talking about): http://touhou.ru/dev/webgl-test-stackoverflow /
And this is how I load the grid and materials using JSONLoader:
var player_loader = new THREE.JSONLoader(); player_loader.load( "running_babe.js", function(geo, material) { material[0].morphTargets = true; material[1].morphTargets = true; var materials = new THREE.MeshFaceMaterial(material); player = new THREE.Mesh( geo, materials ); scene.add(player); });
Am I doing something wrong?
UPDATE: The problem was in my export. Now the second material looks like this:
{ "DbgColor" : 15597568, "DbgIndex" : 1, "DbgName" : "Material.001", "blending" : "NormalBlending", "colorAmbient" : [0.6400000190734865, 0.6400000190734865, 0.6400000190734865], "colorDiffuse" : [0.6400000190734865, 0.6400000190734865, 0.6400000190734865], "colorSpecular" : [0.5, 0.5, 0.5], "depthTest" : true, "depthWrite" : true, "mapDiffuse" : "kourindouhime.jpg", "mapDiffuseWrap" : ["repeat", "repeat"], "shading" : "Lambert", "specularCoef" : 50, "transparency" : 1.0, "transparent" : false, "vertexColors" : false }
and it works very well. Thanks guys.