Lights

Software: Away3D 4.x

view, Newbie
Posted: 07 March 2012 05:54 PM   Total Posts: 12

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.0;
   
light.0;
   
light.color 0xFFFFFF;
   
light.ambient 1;
   
light.specular 1;
   
lightPicker= new StaticLightPicker([light])   
  
}

private function onLoadedFirstLevel(e:AssetEvent) : void
  {

for(var i:Number=0i<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);

     
    
   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X