Hey Julian

you need to use a material on you sphere that actually responds to light. in
the case of PointLight3D, the material to use is called ShadingColorMaterial

attached is a handy example of using the ShadingColorMaterial - hope that
gives you some clues on its use!

cheers

Rob

On Sun, Dec 20, 2009 at 12:17 AM, juliancruz87 <[email protected]>wrote:

> Good evening, I tried using all the lights and no I reflected on the
> scene, I can not do with that, I need urgent and I could not solve it,
> put this code sample of what I'm doing, in simplified and the original
> is more complex and would be tedious for the person who read it could
> help, Thanks for everything.
>
> import away3d.containers.*;
> import away3d.cameras.*;
> import away3d.loaders.*;
> import away3d.events.*;
> import away3d.materials.*;
> import away3d.core.base.*;
> import away3d.core.render.*;
> import away3d.core.utils.*;
> import away3d.lights.*;
> import away3d.primitives.*;
>
> var view:View3D;
> var scene:Scene3D;
> var camera:HoverCamera3D;
> var light:PointLight3D;
> var viewBG:Sprite = new Sprite();
>
>
> viewBG.graphics.lineStyle(3,0xff9900);
> viewBG.graphics.beginFill(0xFFAA00);
> viewBG.graphics.drawRect(0,0,500,500);
>
> camera = new HoverCamera3D();
> scene = new Scene3D();
> view = new View3D
> ({camera:camera,scene:scene,renderer:Renderer.CORRECT_Z_ORDER});
> view.background.addChild(viewBG);
> view.x=view.y=0
> addChild(view);
>
> var esfera:Sphere = new Sphere({segmentsH:8,segmentsW:8,radius:
> 100,material:"red#white"});
> view.scene.addChild(esfera);
>
> light=new PointLight3D({ambient:60,diffuse:50,color:0x000000,specular:
> 180,brightness:5});
> light.z=500;
> view.scene.addChild(light);
> addEventListener(Event.ENTER_FRAME,enterFrame);
> function enterFrame(event:Event):void{
>        view.render();
> }
>



-- 
Rob Bateman
Flash Development & Consultancy

[email protected]
www.infiniteturtles.co.uk
www.away3d.com

Attachment: Basic_Shading.as
Description: Binary data

Reply via email to