It is simple enough to load a single image onto a plane using the technique below.
PHP Code:
public function load_image():void {
photo_loader = new Loader();
photo_loader.load(new URLRequest("image.jpg");
photo_loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, image_loading);
photo_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, image_loaded);
}
public function image_loaded(e:Event):void {
mat = new BitmapFileMaterial("image.jpg");
plane = new Plane(mat, 600, 450, 4, 4);
scene.addChild(plane);
camera.zoom = 100;
renderer.renderScene(scene, camera, viewport);
}
However, I have been unable to load successive images from a gallery successfully. Typically what happens is I get a triangular frame portion of the next loaded image, regardless of whether I've removed the plane from the scene. I need some way of either totally removing the scene and building a new one with the next image, or refreshing the existing plane with the complete image. Has anyone done this successfully?
Originally I loaded images onto a movieclip and built the image map from that, but I had some issues with 3d animation and loading when using that method.
Thanks for the help!