Hi,
I'm trying to load a collada file into a swf with away3d 3.5. I don't
have the slightest clue why it doesn't work. I hope you can help me
with this.
My code looks like this and I think I've done everything right.
package de.kai_reinhardt
{
import away3d.materials.ColorMaterial;
import away3d.primitives.Cube;
import flash.display.Sprite;
import flash.events.Event;
import away3d.loaders.Collada;
import away3d.cameras.Camera3D;
import away3d.containers.View3D;
import away3d.loaders.Loader3D;
/**
* ...
* @author Kai Reinhardt
*/
public class Main extends Sprite
{
private var view: View3D = new View3D ( {camera:cam } );
private var l: Loader3D = new Loader3D ();
private var cube : Cube = new Cube ();
private var light : DirectionalLight3D = new
DirectionalLight3D( { color:0xFFFFFF, brightness:.9, specular:.25,
ambient:.8, diffuse:.5 } );
public function Main():void
{
trace("MAIN ENTRY");
if (stage) init();
else addEventListener (Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void
{
removeEventListener (Event.ADDED_TO_STAGE, init);
view.scene.addLight (light);
l = Collada.load ("dingens2.dae");
view.scene.addChild(l);
//view.scene.addChild (cube);
addChild (view);
view.render();
}
}
}
But nothing shows up. Whats going wrong? Is it something with the
collada model?
Thanks!