Hi everyone again! Im trying to get some nice shading on a sphere made up of segments. All the examples I have tried dont show anything. Originally it was using a phong material (old away3d) which had some directional light bringing out the sphere. I am trying to achieve this with a3d4 but no joy!
Also maybe off base the material is only interactive on one side?
Thanks in advance people, its been a long day!
private function initLights():void
{
light = new PointLight();
light.x = 0;
light.z = 0;
light.color = 0xFFFFFF;
light.ambient = 1;
light.specular = 1;
lightPicker= new StaticLightPicker([light])
}
private function onLoadedFirstLevel(e:AssetEvent) : void
{
for(var i:Number=0; i<4 ; i++)
{
primitiveMaterial = new ColorMaterial(colours[i]);
primitiveMaterial.bothSides=true;
primitiveMaterial.lightPicker=lightPicker;
primitiveMaterial.diffuseLightSources = LightSources.LIGHTS;
var obj:Mesh = mesh.clone() as Mesh;
var meshContainer:ObjectContainer3D = new ObjectContainer3D;
obj.castsShadows=true;
meshContainer.rotationY=i*90;
obj.material=primitiveMaterial;
obj.mouseEnabled=true;
obj.name = _xml.item.(@parentID == "0")[i].@id;
meshContainer.addChild(obj);
level1Container.addChild(meshContainer);
}