mesh shadow is wrong,Why?

Software: Away3D 4.x

datouaizi, Member
Posted: 01 November 2011 10:38 AM   Total Posts: 98

view3D.camera.z = -100;
view3D.camera.y = 60;

var light:PointLight = new PointLight();
light.color = 0xffffee;
light.position=new Vector3D(100,100,-1000);
light.radius = 1000 ;
 
light.visible=true ;
 
view3D.scene.addChild(light);
 
var mesh1:Mesh = model.getChildByName(“body”) as Mesh ;
mesh1.castsShadows = true ;
mesh1.material.bothSides = true;
mesh1.material.lights = [light];


what`s wrong with my script?

 

   

Avatar
Choons, Sr. Member
Posted: 01 November 2011 04:47 PM   Total Posts: 281   [ # 1 ]

maybe it’s because your light radius is 1000 and you’ve positioned it 1000 units away? try increasing the radius or moving the light closer

   

Avatar
Cheng Liao, Administrator
Posted: 02 November 2011 01:40 AM   Total Posts: 116   [ # 2 ]

You should add a TripleFilteredShadowMapMethod(or SoftShadowMapMethod,FilteredShadowMapMethod,and so on) to the material of the ground.Please refer to https://github.com/away3d/away3d-examples-broomstick/blob/master/src/SoftShadowTest.as.

Formerly,only DirectionalLight can produce shadow.I don’t know if it’s still now.

   

datouaizi, Member
Posted: 02 November 2011 01:16 PM   Total Posts: 98   [ # 3 ]
liaocheng - 02 November 2011 01:40 AM

You should add a TripleFilteredShadowMapMethod(or SoftShadowMapMethod,FilteredShadowMapMethod,and so on) to the material of the ground.Please refer to https://github.com/away3d/away3d-examples-broomstick/blob/master/src/SoftShadowTest.as.

Formerly,only DirectionalLight can produce shadow.I don’t know if it’s still now.

thanks!but mesh.material doesn`t has shadowMethod Method,
only colorMaterial has .

   

Avatar
Cheng Liao, Administrator
Posted: 02 November 2011 02:24 PM   Total Posts: 116   [ # 4 ]

mesh.material is BitmapMaterial indeed.You can cast is to BitmapMaterial.(BitmapMaterial(mesh.material))
Don’t use shadowMethod,use addMethod Instead .

   

datouaizi, Member
Posted: 02 November 2011 03:15 PM   Total Posts: 98   [ # 5 ]
Choons - 01 November 2011 04:47 PM

maybe it’s because your light radius is 1000 and you’ve positioned it 1000 units away? try increasing the radius or moving the light closer

 

it is not work.

model.z= -1000
light.z=-800
light.radius = 1000.

so the model is in the light radius.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X