Broomstick: Specular Material

Software: Away3D 4.x

conrad, Newbie
Posted: 14 August 2011 05:23 PM   Total Posts: 1

Hi all,

I am trying to make a basic shiny in Away3D 4.

I have tried this

        var m:ColorMaterial = new ColorMaterial( 0xFF0000 );
        m.gloss = 0.5;
        m.specular = 0.5;
        m.specularColor = 0xffffff;

but unfortunately it is just a red material with no shininess at all.

Are there any simple broomstick examples of simple shiny materials?

Thanks

   

Avatar
80prozent, Sr. Member
Posted: 14 August 2011 05:30 PM   Total Posts: 430   [ # 1 ]

hi

i guess your material is fine…

all you miss is a light that let it shine smile

var _light:DirectionalLight = new DirectionalLight(0, -11);
_light.specular 1;
_light.diffuse 1;
_light.color 0xffffff;
_view.scene.addChild(_light);


YourMaterial.lights [_light]

hope that helps

 Signature 

sorry…i hope my actionscript is better than my english…

   

Avatar
theMightyAtom, Sr. Member
Posted: 14 August 2011 05:33 PM   Total Posts: 669   [ # 2 ]

You’ll find lots of examples on GutHub.
I suspect what you’re missing is lights.
m.lights = [someLight, anotherLight];

https://github.com/away3d/away3d-examples-broomstick

Try for example https://github.com/away3d/away3d-examples-broomstick/blob/master/src/LightingTest.as

Good Luck!

   

conrad, Newbie
Posted: 15 August 2011 05:12 AM   Total Posts: 1   [ # 3 ]

Thanks, that solved it - I had a light added to the scene, but I had not applied it to the material.

Cool grin

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X