Away3D Gold Practice11 Base64形式画像をPlaneのテクスチャとして使用
/**
* Copyright siouxcitizen ( http://wonderfl.net/user/siouxcitizen )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/bk1d
*/
// forked from siouxcitizen's Away3D Gold Practice10 Wonderflサーバに置いた画像をPlaneのテクスチャとして使用
// forked from siouxcitizen's Away3D Gold Practice09 Torus表示
// forked from siouxcitizen's Away3D Gold Practice08 Cylinder表示実験
// forked from siouxcitizen's Away3D Gold Practice06 Cube 5つ表示
// forked from siouxcitizen's Away3D Gold Practice05 光のあて方よくわからない。。。
// forked from siouxcitizen's Away3D Gold Practice04 SphereとWireframeSphere表示
// forked from siouxcitizen's Away3D Gold Practice03 WireframePlane 5枚表示
// forked from siouxcitizen's Away3D Gold Practice02 Plane 5枚表示
// forked from siouxcitizen's Away3D Gold Practice01 Plane 1枚表示
//
//Away3D 4.0 Gold でPlaneにBase64形式の画像をテクスチャとして貼り付けてみました
//画像形式が異なるからなのか?ドット数が異なるからなのか? 一部画像がとりこめませんでした
//
//自分作成の昔のコードを参考にしました
//Away3D練習10 Base64形式画像をPlaneのテクスチャとして使用
//http://wonderfl.net/c/pOvw
//
package {
import away3d.containers.View3D;
import away3d.containers.Scene3D;
import away3d.cameras.Camera3D;
import away3d.debug.AwayStats;
import away3d.entities.Mesh;
import away3d.materials.TextureMaterial;
import away3d.primitives.PlaneGeometry;
import away3d.primitives.PrimitiveBase;
import away3d.utils.Cast;
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Vector3D;
import flash.display.Bitmap;
import flash.display.BitmapData;
[SWF(backgroundColor="#FFFFFF", frameRate="60", width="465", height="465")]
public class PlaneTextureSample extends Sprite {
private static const ZERO : Vector3D = new Vector3D(0, 0, 0);
private var _view : View3D;
private var _scene : Scene3D;
private var _camera : Camera3D;
private var _zakuPlaneOmote : Mesh;
private var _zakuPlaneUra : Mesh;
private var _slaPlaneOmote : Mesh;
private var _slaPlaneUra : Mesh;
private var _wizPlaneOmote : Mesh;
private var _wizPlaneUra : Mesh;
//Base64表現によるテクスチャ用画像データ zaku画像
private var _textureZakuImgData : String = "/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAQDAwQDAwQEAwQFBQQFBwwHBwYGBw4KCwgMEQ8SEhEPEBATFRsXExQaFBAQGCAYGhwdHh8eEhchJCEeJBseHh0BBQUFBwYHDgcHDh0TEBMdHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHf/AABEIAIAAgAMBIgACEQEDEQH/xAGiAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgsQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+gEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoLEQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APv6iiigAooooAKKKKACuP8Aize3Om/CzxxeadcS215baJeywzwuUeJ1gcqysOQQQCCOldhXiX7Xf/JvHjH/ALdP/SuGoqO0G/IzqvlhJ+TPbaK4j4Nf8kg+H/8A2ALH/wBJ0rt6pO6uXF3SYUUUUxhRRRQAUUUUAFFFFABRRXkHxj+P2h/DG1u9Ps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4wiZIXjjPJ5bnBxXoFFFfF4nFVcVUdWtLmb/r5eh9zhcJRwlNUqEVGK7f1q/NhRRRWB0BRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQB//Z"
//Base64表現によるテクスチャ用画像データ wizard画像
private var _textureWizImgData : String = "/9j/4AAQSkZJRgABAQAAAQABAAD//gA+Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2NjIpLCBkZWZhdWx0IHF1YWxpdHkK/9sAQwAIBgYHBgUIBwcHCQkICgwUDQwLCwwZEhMPFB0aHx4dGhwcICQuJyAiLCMcHCg3KSwwMTQ0NB8nOT04MjwuMzQy/9sAQwEJCQkMCwwYDQ0YMiEcITIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy/8AAEQgAlgCWAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/aAAwDAQACEQMRAD8A9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nIdMY/M12Nh8BvDsCRm+vr+6lUgvtZY0b2xgkD/gVd/ovhjRfD0YTS9Nt7Y42l0Qb2+rdT+JorYrnjyozxGNVSHIjWopaK4jzhKKWigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAEooooA//2Q=="
private const UV_DATA:Array =
[
_textureZakuImgData,
_textureSlaImgData,
_textureWizImgData
];
private var _count : int = 0; // 読み込んだ画像数
private var _images : Array; // 読み込んだUV画像保持用配列
private var _capture : BitmapData = new BitmapData(465, 465, false, 0x000000);
public function PlaneTextureSample() {
// wonderfl capture
Wonderfl.disable_capture();
//addChild(new Bitmap(_capture)) ;
_images = new Array(UV_DATA.length);
for (var i:int = 0; i < UV_DATA.length; i++)
{
Base64ImageLoader( UV_DATA[i], i, onComplete );
}
}
private function onComplete( event:Event ):void {
var uv:Bitmap = event.target.content as Bitmap;
_images[event.currentTarget.loader.name] = uv;
if (++_count == UV_DATA.length) display();
}
private function display():void {
_view = new View3D();
_scene = _view.scene;
_camera = _view.camera;
addChild(_view);
_view.antiAlias = 0;
_view.backgroundColor = 0x555555;
_camera.y = 0;
_camera.z = -700;
_zakuPlaneOmote = new Mesh(new PlaneGeometry(200, 200), new TextureMaterial(Cast.bitmapTexture(_images[0])));
_zakuPlaneOmote.x = 0;
_zakuPlaneOmote.y = 250;
_scene.addChild(_zakuPlaneOmote);
//doubleSidedプロパティがうまく設定できないのでごまかし気味に。。。
_zakuPlaneUra = new Mesh(new PlaneGeometry(200, 200), new TextureMaterial(Cast.bitmapTexture(_images[0])));
_zakuPlaneUra.rotationX = 180;
_zakuPlaneUra.rotationY = 180;
_zakuPlaneOmote.addChild(_zakuPlaneUra);
_slaPlaneOmote = new Mesh(new PlaneGeometry(200, 200), new TextureMaterial(Cast.bitmapTexture(_images[1])));
_slaPlaneOmote.x = -250;
_slaPlaneOmote.y = 0;
_scene.addChild(_slaPlaneOmote);
//doubleSidedプロパティがうまく設定できないのでごまかし気味に。。。
_slaPlaneUra = new Mesh(new PlaneGeometry(200, 200), new TextureMaterial(Cast.bitmapTexture(_images[1])));
_slaPlaneUra.rotationX = 180;
_slaPlaneUra.rotationY = 180;
_slaPlaneOmote.addChild(_slaPlaneUra);
//3つめの画像うまく取り込めないみたいなので、テキトーに。。。
//ファイル形式が違うから??? ドット数が違うから???
_wizPlaneOmote = new Mesh(new PlaneGeometry(200, 200), new TextureMaterial(Cast.bitmapTexture(_images[0])));
_wizPlaneOmote.x = 250;
_wizPlaneOmote.y = 0;
_scene.addChild(_wizPlaneOmote);
//doubleSidedプロパティがうまく設定できないのでごまかし気味に。。。
_wizPlaneUra = new Mesh(new PlaneGeometry(200, 200), new TextureMaterial(Cast.bitmapTexture(_images[1])));
_wizPlaneUra.rotationX = 180;
_wizPlaneUra.rotationY = 180;
_wizPlaneOmote.addChild(_wizPlaneUra);
addEventListener(Event.ENTER_FRAME, update);
addChild(new AwayStats());
}
private function update(event : Event) : void {
_zakuPlaneOmote.rotationX = -(stage.mouseY - (stage.stageHeight >> 1));
_zakuPlaneOmote.rotationY = stage.mouseX - (stage.stageWidth >> 1);
_slaPlaneOmote.rotationX = -(stage.mouseY - (stage.stageHeight >> 1));
_slaPlaneOmote.rotationY = stage.mouseX - (stage.stageWidth >> 1);
_wizPlaneOmote.rotationX = -(stage.mouseY - (stage.stageHeight >> 1));
_wizPlaneOmote.rotationY = stage.mouseX - (stage.stageWidth >> 1);
_camera.lookAt(ZERO);
_view.render();
//_view.renderer.queueSnapshot(_capture);
}
}
}
//Base64化された画像データを表示可能な形式に変換するクラス
import flash.display.Loader;
import flash.events.Event;
function Base64ImageLoader( data:String, i:int, complete:Function = null ):Loader
{
var loader:Loader
loader = new Loader();
if( complete != null )
loader.contentLoaderInfo.addEventListener( Event.COMPLETE, complete );
loader.loadBytes( Base64toByteArray( data ) );
loader.name = i.toString();
return loader;
}
import flash.utils.ByteArray;
import mx.utils.Base64Decoder;
function Base64toByteArray( data:String ):ByteArray
{
var byteArray:ByteArray;
var base64Decoder:Base64Decoder;;
base64Decoder = new Base64Decoder();
base64Decoder.decode(data);
try {
byteArray = base64Decoder.toByteArray();
byteArray.position = 0;
} catch (e:Error) {
return null;
}
return byteArray;
}