Hi,
I’m new to Away3D (and seem to have started to trying to use it at the start of a new version when there’s barely any tutorials/help around) so I opened up one of the example files and tried to import a simple model using it (Basic_LoadOBJ.as on the git repository).
I’m trying to follow it through whilst removing some of the extra functionality (mouse movement and texturing mainly) as I just want to get something imported for now, but have come across a weird error.
I’m getting this:
[Fault] exception, information=Error: Error #2032: Stream Error. URL: file:///C|/Users/Ollie/Documents/Flash Projects/Test/bin/hex.mtl
But the file I tried to embed is hex.obj - nowhere have I told it that there’s a file called hex.mtl (because there isn’t) and I don’t know why it’s looking for it in the bin folder.
There’s a chance I’ve taken out something that was needed so here’s a stripped down version of my class in case that helps:
private function init(e:Event):void {
removeEventListener(Event.ADDED_TO_STAGE, init);
initEngine();
initObjects();
addEventListener(Event.ENTER_FRAME, update);
}
private function initEngine():void {
stage.align = StageAlign.TOP_LEFT;
scene = new Scene3D;
camera = new Camera3D;
view = new View3D;
view.antiAlias = 4;
view.scene = scene;
view.camera = camera;
//cameraControl = new HoverController(camera, null, 45, 10, 800);
}
private function initObjects():void {
Parsers.enableAllBundled();
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete);
AssetLibrary.loadData(new HexModel);
}
private function onAssetComplete(e:AssetEvent):void {
if (e.asset.assetType == AssetType.MESH) {
hex = e.asset as Mesh;
hex.geometry.scale(100);
hex.y = -50;
hex.material = new ColorMaterial(0x8080FF, 1);
scene.addChild(hex);
}
}
private function update(e:Event):void {
trace("update");
//view.render();
}
Any help would be greatly appreciated, I don’t understand at all why it’s looking for a .mtl file
Ollie