you have lots of zero's in there...

but your first question was about having objects with 2 materials
so does this means you want to map each sphere with a dark and a bright side?

Personally I would use normalmap+dot3material for this and use Prefab to render map with shadows off for the tracer. It can generate the normalmap for you as well, but since its a sphere a single small map can be generated runtime at very low cost (only once for all spheres).
using NormalMapGenerator or NormalBumpMaker, both in materials.utils

here a year old example using this combo
http://www.closier.nl/playground/normalmaps2.html

if you want highly detailed map, Prefab can also raytrace it for you.

Fabrice



On Dec 18, 2009, at 5:22 PM, Tiago Machado wrote:

Hi Fabrice,

This is my code, I create two spheres to simulates the earth and the
moon, then I lighting these objects with a PointLight3D, but they are
seen with a flat aspect, I would like to have the same effect that I
have with the PointLight3D (the side towards to the sun lighting and
the other side dark), but with smooth objects.

I tried used a PhongBitmapMaterial with DirectionalLight3D or
AmbientLight3D, although i didn“t reached a good result. In fact, the
objects can be seen in a smooth aspect with these lights and
materials, but we cannot see the lighting differences between the two
objects sides.

Thanks.

Tiago.

package {
        import away3d.containers.Scene3D;
        import away3d.containers.View3D;
        import away3d.core.math.Number3D;
        import away3d.lights.AmbientLight3D;
        import away3d.lights.PointLight3D;
        import away3d.loaders.utils.MaterialLibrary;
        import away3d.materials.BitmapMaterial;
        import away3d.materials.IMaterial;
        import away3d.materials.WhiteShadingBitmapMaterial;
        import away3d.materials.utils.SimpleShadow;
        import away3d.primitives.Sphere;

        import flash.display.Bitmap;
        import flash.display.Sprite;
        import flash.events.Event;

        [SWF(backgroundcolor = "#000000000")]
        public class TesteLuz extends Sprite
        {
                private var light:PointLight3D;
                private var sphere:Sphere;
                private var sphere2:Sphere;
                private var v:View3D;

                public function TesteLuz()
                {
                        v = new View3D();
                        v.x = 200;
                        v.y = 230;
                        this.addChild(v);
                        v.scene = new Scene3D();

                    //light
                        light = new PointLight3D({x:80, y:0, z:0, brightness:5, 
ambient:30,
specular:180, diffuse:30});
                        v.scene.addChild(light);
                        light.visible = true;

                        //earth sphere & white shadingg bitmap material
                        [Embed(source = "assets/earth.jpg")]
                var Earth:Class;

                        var earthBmp:Bitmap = new Earth() as Bitmap;
                        var earthMat:WhiteShadingBitmapMaterial = new
WhiteShadingBitmapMaterial(earthBmp.bitmapData);
                        earthMat.ambient_brightness = 0;
                        earthMat.diffuse_brightness = 1.7;
                        earthMat.specular_brightness = 0;

                        sphere = new Sphere({radius:15, material:earthMat});
                        v.scene.addChild(sphere);

                        //moon sphere & white shadingg bitmap material
                        [Embed(source = "assets/moon.jpg")]
                var Moon:Class;

                        var moonBmp:Bitmap = new Moon() as Bitmap;
                        var moonMat:WhiteShadingBitmapMaterial = new
WhiteShadingBitmapMaterial(moonBmp.bitmapData);
                        moonMat.ambient_brightness = 0;
                        moonMat.diffuse_brightness = 1.7;
                        moonMat.specular_brightness = 0;

                        sphere2 = new Sphere({radius:5, material:moonMat, x:-60 
});
                        v.scene.addChild(sphere2);

                        v.render();
                }

        }
}


On Dec 17, 3:52 pm, Fabrice3D <[email protected]> wrote:
Sure I wanna help you but in this case
this is pretty much all you need...

Show your code snippet where things go wrong or do not work
then I might be able to help you more.

Fabrice

On Dec 17, 2009, at 7:22 PM, Tiago Machado wrote:

hi fabrice,

can you send me further details?

thx

tiago.

On Dec 16, 5:48 pm, Fabrice3D <[email protected]> wrote:
you need to set the materials at face level.

Like mesh.faces[index].material = ITriangleMaterial

Fabrice

On Dec 16, 2009, at 6:11 PM, Tiago Machado wrote:

how can i associate two or more materials with the same object?

i want to lighting an object with a pointLight3D and an
ambientLight3D
using whiteShadingMaterial and phongBitmapMaterial.

thx.

tiago.

Reply via email to