Still not able to get it to work. :(
This is the code I use to setup the materials, and models.
parser.loadData(event.target.data);
var groundMaterial:BitmapMaterial = new BitmapMaterial(new dirtTexture(), true, false, true);
groundMaterial.ambient = 0.2;
groundMaterial.specular = 0.2;
groundMaterial.gloss = 30;
groundMaterial.lights = lightList;
groundMaterial.shadowMethod = new FilteredShadowMapMethod(directionalLight);
var ground:Plane = new Plane(groundMaterial, 30, 30, 1, 1, true);
ground.y = -4;
container.addChild(ground);
var material:BitmapMaterial = new BitmapMaterial(modelTexture,true,false,false);
material.ambient = lightAmbient;
material.specular = 0.6;
material.ambientColor = 0xFFFFFF;
material.lights = lightList;
material.shadowMethod = new FilteredShadowMapMethod(directionalLight);
for (var i:int = 0; i<parser.numChildren; i+=1) {
var mesh:Mesh = parser.getChildAt(i) as Mesh;
mesh.material = material;
mesh.castsShadows = true;
container.addChild(mesh);
}
Apparently view.camera.lens.far was too high, and it wouldn’t display shadows…
I’m sorry, but I hate checking my code 20 times to find out something like that ends up being the problem…
You should put a comment in the Basic_Load3DS.as example explaining it.