Well I am very surprised ... Usually when one starts experimenting whit new technologies first big unsolvable error comes when doing advanced tutorials. Mine came at the hello world.
package
{
import away3d.containers.View3D;
import away3d.entities.Mesh;
import away3d.materials.TextureMaterial;
import away3d.primitives.PlaneGeometry;
import away3d.textures.BitmapTexture;
import flash.display.Sprite;
import flash.events.Event;
/**
* ...
* @author Gazuraz
*/
public class Main extends Sprite
{
private var view:View3D;
[Embed("spaceship.jpg")]
public static const SpaceShip : Class;
public function Main():void
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
view = new View3D();
addChild(view);
var texture:BitmapTexture = new BitmapTexture(new SpaceShip().bitmapData);
var material_texture:TextureMaterial = new TextureMaterial(texture);
var _view:Mesh = new Mesh(new PlaneGeometry(256, 256, 1, 1, true, true), material_texture);
view.scene.addChild(_view);
_view.rotationX = 90;
addEventListener(Event.ENTER_FRAME, render);
}
private function render(e:Event):void
{
view.render();
}
}
}
throws error:
RangeError: Error #3669: Bad input size.
at flash.display3D::VertexBuffer3D/uploadFromVector()
Normally I would expect this to happen when using advanced meshes and not simple poor basic plane whit 256 X 256 px jpg on a 8 GB RAM computer whit 1024 mb of gamer graphic card…. Does some one know how to fix this ?
The Error is related whit doubleSided property. When material is not doubleSided there is no error.