Hi, I have been playing with the tutorial posted here:
http://www.flashmagazine.com/Tutorials/detail/create_the_earth_and_heavens_in_less_than_an_hour_with_away3d/
...to get used to Away3D. I'm thrashing around in the dark (pardon the
pun) a bit as most of the tutorials are pretty out of date. I would
like to use a PointLight3D to illuminate the Earth. This works well if
I set the Earth texture to be a WhiteShadingBitmapMaterial but I see
no lighting at all using PhongBitmapMaterial. The relevant bits of
code are as follows:
var sunLight = new PointLight3D();
sunLight.position = new Number3D(0,0,600);
sunLight.brightness = 1;
scene.addLight(sunLight);
// Lighting works using this...
var globeMaterial:WhiteShadingBitmapMaterial = new
WhiteShadingBitmapMaterial(Cast.bitmap("earthmap1k.jpg"));
// ...but not using this
var globeMaterial:PhongBitmapMaterial = new
PhongBitmapMaterial(Cast.bitmap("earthmap1k.jpg"));
globeMaterial.shininess = 20;
var globe:Sphere = new Sphere({material:globeMaterial,radius:
150,segmentsH:18, segmentsW:26});
scene.addChild(globe);
var sun = new Sphere({material:"sunmap.jpg",radius:50,x:0,y:0,z:
600,segmentsH:6, segmentsW:6});
scene.addChild(sun);
If it helps, the fla is available here:
http://www.telescope.org/~scott/earth3D.fla.
I am using Away3D 2.5.2 and building with Flash CS3 Professional.
Thank you for taking the time to look at this, I can think of loads of
stuff to do with Away3D once I properly understand the basics!