Hi guys, I’ve just started using Away3D.
Although it’s pretty easy to use ( managed to figure most of the things for myself ), i still can’t get the following thing to work.
So i’m trying to set the atmosphere for a planet ( ex. Earth ) by using a larger sphere (with a transparent png ) on top of the planet’s “terrain” sphere. Problem is the atmosphere sphere doesn’t show at all ( tried to change the image used for the texture since i thought it may be from the alpha issues i’ve been hearing about but it still doesn’t work ).
Note: the “terrain” sphere always shows correctly, so it may be related to z-sorting or the way i’m building the 2nd sphere ? o.O
The images are loaded through Loader3D and i can see from the traces that they are loaded succesfully…also if i apply the atmosphere texture on the “terrain” sphere, it shows correctly. Below is the planet creation code ( the class extends ObjectContainer3D class so i can move the whole planet more easily ).
/**
* builds the planet
* @param pW the radius o the planet
* @param segH number of horizontal segments
* @param segV number of vertical segments
* @param lightPicker the lightPicker to be used for materials
*/
public function init(pW:Number, segH:uint, segV:uint, lightPicker:StaticLightPicker):void
{
_radius = pW;
var geom:SphereGeometry = new SphereGeometry(pW, segH, segV);
var material:TextureMaterial = new TextureMaterial(_meshTexture);
material.lightPicker = lightPicker;
material.specular = 0;
_mesh = new Mesh(geom, material);
addChild(_mesh);
if (!_atmTexture)
return;
geom = new SphereGeometry(pW + 1 , segH, segV);
material = new TextureMaterial(_atmTexture);
material.alphaBlending = true;
material.lightPicker = lightPicker;
material.specular = 0;
_atmMesh = new Mesh(geom, material);
addChild(_atmMesh);
trace(_mesh.position + " " + _atmMesh.position);
trace(SphereGeometry(_mesh.geometry).radius + " " + SphereGeometry(_atmMesh.geometry).radius);
}
Any help would be greatly appreciated ^^