There’s no PhongColorMeterial in away3d 4.1.1 any more?

Software: Away3D 4.x

Percy, Newbie
Posted: 22 June 2013 02:40 PM   Total Posts: 12

I have created a light as following:

var light:DirectionalLight=new DirectionalLight();
scene.addChild(light); 

and created a mesh as following:

var sphereGeometry:SphereGeometry = new SphereGeometry(100);
   var 
sphereMaterial:ColorMaterial = new ColorMaterial0xff0000 );
   var 
mesh:Mesh = new Mesh(sphereGeometrysphereMaterial);
   
scene.addChild(mesh); 

But the sphere is just a plain red sphere. It is not illuminated by the light.

   

Avatar
Fabrice Closier, Administrator
Posted: 22 June 2013 08:14 PM   Total Posts: 1265   [ # 1 ]

you need to declare a StaticLightPicker, say a sort of a light group, you pass your light to it, and assign the picker to the material.

You can also play with lights within Prefab, export as AS3 and study the PrefabProject.as class or the many examples on git.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X