colormaterial lights

Software: Away3D 4.x

pool338, Jr. Member
Posted: 12 March 2012 11:23 AM   Total Posts: 37

Hello,
i just downloaded away3d 4.0 beta and noticed, that i’m not able to set the lights of a colormaterial directly anymore.

I was doing something like that:

_material = new ColorMaterial(uint(colorName));
_material.lights [_light_light2]

How can I do this in away3d 4.0 beta?

   

John Wilson, Member
Posted: 12 March 2012 03:05 PM   Total Posts: 62   [ # 1 ]

You need to us a light picker. Something like:

import away3d.materials.lightpickers.*;

var 
lightPicker1:StaticLightPicker;
lightPicker1 = new StaticLightPicker([light1light2]);
_material.lightPicker lightPicker1
   

asherritt, Newbie
Posted: 29 March 2012 09:44 AM   Total Posts: 14   [ # 2 ]

So excited to be working on this!
I’m having difficulty understanding the lighting techniques though. So when you create a material you need to give it a lightpicker in order to receive and cast shadows correct?

But what happens when the light isn’t created yet? If you add a light to a scene, how do you get it to be applied on the existing meshes?

With one pointlight already added and casting shadows, I later try to create a new light and pushing the newly created light into my light picker, ie.

staticLightPicker.lights.push(new PointLight())

but the newly added light has no effect. Do I need to call an update of some sort?

One really good comprehensive example, showing all the different ways to set up materials and lights would go a long way. The API documentation is a little cryptic, with enticing sounding properties/methods like, diffuseLightSources, collectLights(), and fogMethod, but not a lot of demonstration on how to use them. Tell me and I will be happy to create a tutorial to share!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X