emotionDiver3D
ある人のお誕生会のために作ったモノ。赤青メガネを使うと、飛び出て見えるはず。
Flashのステージをクリックすると、メッセージが表示されます。
エレクトロなバンドのVJ係として、バラードに合わせてメッセージが少しずつ出てくるように作った。なので、ステージサイズ640*480向けに作ったものなので文字が欠けちゃうけどご容赦。
実際本番ではプロジェクターで投影したんだけど、色がずれてて焦った焦ったw
本番直前まで(お客さんの目の前で)色合わせしたのも今ではいい思い出です。
◆参考:アナグリフ
http://www.stereoeye.jp/howto/anaglyph.html
▼Wonderfl
http://wonderfl.net/code/d9b0e90e27e283869dfe3eac6b7eb9e3680064e0
▼ActionScript AS3(FP9)
[sourcecode language=”as3″]
/*
emotionDiver3D
ある人のお誕生会のために作ったモノ。
赤青メガネを使うと、飛び出て見えるはず。
エレクトロなバンドのVJ係として、
バラードに合わせてメッセージが
少しずつ出てくるっていうやつ。
なので、元々ステージサイズ640*480向けに
作ったものなので、文字が欠けちゃうけど許して。
実際本番ではプロジェクターで投影したんだけど、
色がずれてて焦った焦ったw
本番直前まで色合わせ。
コードのごちゃごちゃはご容赦。
こんなの本人でも直せないよw
*/
package{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.KeyboardEvent;
import flash.display.BlendMode;
import flash.ui.Mouse;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.TextFieldAutoSize;
import flash.display.StageScaleMode;
[SWF(width="465", height="465", frameRate="30", backgroundColor="0x000000")]
public class Test extends Sprite {
private const initStageWidth:int = stage.stageWidth;
private const initStageHeight:int = stage.stageHeight;
private var stageWidth:int = stage.stageWidth;
private var stageHeight:int = stage.stageHeight;
private var fullScreenBtn:Sprite = new Sprite();
function Test(){
stage.scaleMode = StageScaleMode.NO_SCALE;
//Mouse.hide();
///////
var origin_array:Array = new Array();
var msg_array:Array = new Array();
var msg0_array:Array = new Array("水玉さんスキじゃお〜★おめでとないっ♪<br>メッセージ0","おめでとうございます!!<br>大阪のネイリストより☆ <br>メッセージ1","Happy Birthday!! <br>遠く大阪よりお祝いしま〜す。<br>メッセージ2","本日は参加できなくて、<br>ホンマすいません! <br>20代最後のお誕生日、<br>おめでとう! <br>メッセージ3","おめでとぉーーーーう!<br>今度是非新居に遊びに来てね!<br>メッセージ4","姫にとって良い歳でありますように。<br>Happy Birthday!!<br>メッセージ5","お誕生日オメデトウ<br>また会いましょうね <br>メッセージ6","おめでとー!<br>メッセージ7","誕生日おめでとう。<br>ますますいい女になってね<br>メッセージ8","僕のこと<br> 覚えてますか?<br> おめでとう!(5・7・5)<br>メッセージ9");
var msg1_array:Array = new Array("生誕2●周年、おめでとうございます! <br>エブリデイ毎日を楽しくエンジョイした<br>人生ライフにしてください。 <br>メッセージ10","誕生日おめでとうございます、<br>いつまでもお美しく<br>メッセージ11 ","あれ?私より年上なんだぁ。<br>うふっ♪<br>メッセージ12","*かつお*〜〜!! <br>HAPPY BIRTHDAY☆<br> FROM NEWYORK <br>かけつけれへんけど、<br>みんなにたっぷり祝ってもらってな。 <br>いつになったらうちに<br>遊びに来てくれるんやろか??待ってるで〜。<br> まあ、まだまだおりそうな予感なので<br>そのうちに来てねん!! <br>HAVE A HAPPY <br>LIFE FOREVERやで。 <br>そして、私らは<br> Life long friendよ☆ <br>かつおの一年が素敵で輝かしい歳になりますように =) <br>メッセージ13","身体ご自愛のほどを。<br>良き1歳にしてください。<br>メッセージ14","素敵なこといっぱいで<br>キラキラな1年になりますように<br>メッセージ15","こころより、お誕生日おめでとう!!<br>メッセージ16","ハッピーバースデー!<br>メッセージ17","お誕生日おめでとー!!<br>めっさ大好きやで〜!!<br>メッセージ18","お誕生日おめでとう!<br>また、ハニビなどのイベントで<br>ご一緒できること、<br>楽しみにしています♪<br>メッセージ19");
var msg2_array:Array = new Array("おめでとう!早く元気に!<br>メッセージ20","一度お会いしたっきりですが、<br>ファンです!おめでとうございます!<br>メッセージ21","☆お誕生日おめでとうございます☆<br> お誕生会に参加出来なくてすみません…<br>大阪から水玉さんにとって<br>素敵な1年になりますよう<br>お祈りしています☆<br>メッセージ22");
msg_array = msg0_array.concat(msg1_array,msg2_array);
var msgpoz_array:Array = new Array();
var msgpoz0_array:Array = new Array([150,-170,-70,-2.424,0,3.087],[215,230,90,-1.24,-0.540,0.572],[0,435,-305,-1.082,0,-0.891],[-420,445,150,-3.309,0.254,0.233],[-180,-475,-360,-1.685,-0.668,1.79],[-200,255,430,-1.495,-0.923,4.339],[-220,120,-520,0.127,0.445,0.636],[-415,-585,260,-0.508,0.827,1.06],[-200,-390,580,-0.381,0,-0.572],[-590,110,380,-0.317,2.402,0]);
var msgpoz1_array:Array = new Array([-170,0,-600,-3.14,0,0],[-80,-390,600,0,3.203,1.655],[-140,360,240,0.254,3.649,0.254],[-170,-290,-520,0.445,0.381,-0.891],[280,-50,30,0,3.14,0.636],[-430,-460,-470,0,-0.3819,3.190],[-340,170,-510,0,3.14,-3],[-540,-130,-250,3.0763,0.063,2.809],[30,-550,330,-0.636,-1.336,0.127],[-260,-260,-590,-0.317,2.465,0]);
var msgpoz2_array:Array = new Array( [-250,350,60,-4.222,0.254,0.0636],[-450,-550,-220,-0.06,3.457,1.718],[-370,-450,-600,-2.821,0.254,3.190]);
msgpoz_array = msgpoz0_array.concat(msgpoz1_array,msgpoz2_array);
var msgcount_num:int = new Number(-1);
var dotline_00_array:Array = new Array([0, ["dotline",0,0], [[0-475, 0-250, 0],[0-475, 200-250, 0]]],[0, ["dotline",0,0], [[0-475, 100-250, 0],[100-475, 100-250, 0]]],[0, ["dotline",0,0], [[100-475, 0-250, 0],[100-475, 200-250, 0]]]);
var dotline_01_array:Array = new Array([0, ["dotline",0,1], [[150-475, 200-250, 0],[200-475, 0-250, 0],[250-475, 200-250, 0]]],[0, ["dotline",0,1], [[175-475, 100-250, 0],[225-475, 100-250, 0]]]);
var dotline_02_array:Array = new Array([0, ["dotline",0,2], [[300-475, 200-250, 0],[300-475, 0-250, 0],[375-475, 0-250, 0],[400-475, 50-250, 0],[375-475, 100-250, 0],[300-475, 100-250, 0]]]);
var dotline_03_array:Array = new Array([0, ["dotline",0,3], [[450-475, 200-250, 0],[450-475, 0-250, 0],[525-475, 0-250, 0],[550-475, 50-250, 0],[525-475, 100-250, 0],[450-475, 100-250, 0]]]);
var dotline_04_array:Array = new Array([0, ["dotline",0,4], [[600-475, 0-250, 0],[650-475, 100-250, 0],[700-475, 0-250, 0]]],[0, ["dotline",0,4], [[650-475, 100-250, 0],[650-475, 200-250, 0]]]);
var dotline_05_array:Array = new Array([0, ["dotline",0,5], [[75-475, 400-250, 0],[100-475, 450-250, 0],[75-475, 500-250, 0],[0-475, 500-250, 0],[0-475, 300-250, 0],[75-475, 300-250, 0],[100-475, 350-250, 0],[75-475, 400-250, 0],[0-475, 400-250, 0]]]);
var dotline_06_array:Array = new Array([0, ["dotline",0,6], [[150-475, 300-250, 0],[150-475, 500-250, 0]]]);
var dotline_07_array:Array = new Array([0, ["dotline",0,7], [[200-475, 500-250, 0],[200-475, 300-250, 0],[275-475, 300-250, 0],[300-475, 350-250, 0],[275-475, 400-250, 0],[200-475, 400-250, 0]]],[0, ["dotline",0,7], [[300-475, 500-250, 0],[275-475, 400-250, 0]]]);
var dotline_08_array:Array = new Array([0, ["dotline",0,8], [[315-475, 300-250, 0],[415-475, 300-250, 0]]],[0, ["dotline",0,8], [[365-475, 300-250, 0],[365-475, 500-250, 0]]]);
var dotline_09_array:Array = new Array([0, ["dotline",0,9], [[450-475, 300-250, 0],[450-475, 500-250, 0]]],[0, ["dotline",0,9], [[450-475, 400-250, 0],[550-475, 400-250, 0]]],[0, ["dotline",0,9], [[550-475, 300-250, 0],[550-475, 500-250, 0]]]);
var dotline_10_array:Array = new Array([0, ["dotline",0,10], [[600-475, 400-250, 0],[600-475, 300-250, 0],[675-475, 300-250, 0],[700-475, 350-250, 0],[700-475, 450-250, 0],[675-475, 500-250, 0],[600-475, 500-250, 0],[600-475, 400-250, 0]]]);
var dotline_11_array:Array = new Array([0, ["dotline",0,11], [[725-475, 500-250, 0],[775-475, 300-250, 0],[825-475, 500-250, 0]]],[0, ["dotline",0,11], [[750-475, 400-250, 0],[800-475, 400-250, 0]]]);
var dotline_12_array:Array = new Array([0, ["dotline",0,12], [[850-475, 300-250, 0],[900-475, 400-250, 0],[950-475, 300-250, 0]]],[0, ["dotline",0,12], [[900-475, 400-250, 0],[900-475, 500-250, 0]]]);
var dotlinecount_num:int = new Number(0);
origin_array = origin_array.concat(dotline_00_array,dotline_01_array,dotline_02_array,dotline_03_array,dotline_04_array,dotline_05_array,dotline_06_array,dotline_07_array,dotline_08_array,dotline_09_array,dotline_10_array,dotline_11_array,dotline_12_array);
var txt_array:Array = new Array();
var txt0_array:Array = new Array([0,["txt",0,0×666666,0],[[350,250,100]]],[0,["txt",0,0×666666,1],[[-410,100,-250]]],[0,["txt",0,0×666666,2],[[210,-400,-300]]],[0,["txt",0,0×666666,3],[[440,400,200]]],[0,["txt",0,0×666666,4],[[-310,-100,400]]],[0,["txt",0,0×666666,5],[[-140,-400,-300]]],[0,["txt",0,0×666666,6],[[-210,50,500]]],[0,["txt",0,0×666666,7],[[600,-100,250]]],[0,["txt",0,0×666666,8],[[-310,500,-400]]],[0,["txt",0,0×666666,9],[[-40,-350,550]]]);
var txt1_array:Array = new Array([0,["txt",0,0×666666,10],[[-70,50,-600]]],[0,["txt",0,0×666666,11],[[410,-100,650]]],[0,["txt",0,0×666666,12],[[-210,-350,300]]],[0,["txt",0,0×666666,13],[[-440,-50,400]]],[0,["txt",0,0×666666,14],[[370,-320,50]]],[0,["txt",0,0×666666,15],[[-440,-400,300]]],[0,["txt",0,0×666666,16],[[210,250,-500]]],[0,["txt",0,0×666666,17],[[-400,-65,-250]]],[0,["txt",0,0×666666,18],[[-150,300,500]]],[0,["txt",0,0×666666,19],[[-440,300,-250]]]);
var txt2_array:Array = new Array([0,["txt",0,0×666666,20],[[70,250,400]]],[0,["txt",0,0×666666,21],[[510,70,-250]]],[0,["txt",0,0×666666,22],[[20,550,-400]]]);
txt_array = txt0_array.concat(txt1_array,txt2_array);
origin_array = origin_array.concat(txt_array);
var vpcutpoint_num:int = new Number(50);
var mcnum_num:int = origin_array.length;
var poz_array:Array = new Array(0,0,1335,0,0,0);
var ballpoz_array:Array= new Array(0,0,0);
var ballpozto_array:Array= new Array(100,100,0);
stage.addEventListener( MouseEvent.CLICK , CLICK );
function CLICK(event:MouseEvent):void{
fc_pozset(90);
fc_pozset(90);
fc_pozset(90);
fc_pozset(66);
}
stage.addEventListener( MouseEvent.MOUSE_WHEEL , onWheel );
function onWheel( event:MouseEvent ):void{
anime_array[3] += event.delta/100;
}
stage.addEventListener( KeyboardEvent.KEY_DOWN , fc_keydown );
var auto_boo:Boolean = new Boolean(false);
function fc_keydown( event:KeyboardEvent ):void{
fc_pozset(event.keyCode);
//trace(event.keyCode);
if(event.keyCode == 191 || event.keyCode == 186){
auto_boo = !auto_boo;
}
}
var currentpoz_num:int = new Number(-1);
var auto_array:Array = new Array(48,49,50,51,52,53,54,55,56,57,65,68,69,70,71,72,73,74,75,76,79,80,81,83,85,87,90);
function fc_pozset(arg_num:*):void{
if(arg_num == "auto"){
if(auto_boo){
arg_num = auto_array[Math.round(Math.random()*auto_array.length)];
}else{
return;
}
}
currentpoz_num = -1;
autorote_boo = false;
switch (arg_num) {
case 32 :
trace(poz_array);
break;
case 37 ://←
poz_array[0] -= 10;
autorote_boo = true;
break;
case 39 ://→
poz_array[0] += 10;
autorote_boo = true;
break;
case 38 ://↑
poz_array[1] -= 10;
autorote_boo = true;
break;
case 40 ://↓
poz_array[1] += 10;
autorote_boo = true;
break;
case 186 :
poz_array[2] -= 10;
autorote_boo = true;
break;
case 189 :
poz_array[2] += 10;
autorote_boo = true;
break;
case 48 ://0
currentpoz_num = 20;
poz_array = [-250,350,60,-4.222,0.254,0.0636];
autorote_boo = true;
break;
case 49 ://1
currentpoz_num = 21;
poz_array = [-450,-550,-220,-0.0636,3.4576,1.718];
autorote_boo = true;
break;
case 50 ://2
currentpoz_num = 22;
poz_array = [-370,-450,-600,-2.821,0.254,3.190];
autorote_boo = true;
break;
case 51 ://3
currentpoz_num = 13;
poz_array = [-170,-290,-520,0.445,0.381,-0.891];
autorote_boo = true;
break;
case 52 ://4
currentpoz_num = 14;
poz_array = [280,-50,30,0,3.14,0.636];
autorote_boo = true;
break;
case 53 ://5
currentpoz_num = 15;
poz_array = [-430,-460,-470,0,-0.3819,3.190];
autorote_boo = true;
break;
case 54 :
currentpoz_num = 16;
poz_array = [-340,170,-510,0,3.14,-3];
autorote_boo = true;
break;
case 55 :
currentpoz_num = 17
poz_array = [-540,-130,-250,3.0763,0.063,2.809];
autorote_boo = true;
break;
case 56 :
currentpoz_num = 18
poz_array = [30,-550,330,-0.636,-1.336,0.127];
autorote_boo = true;
break;
case 57 ://9
currentpoz_num = 19;
poz_array = [-260,-260,-590,-0.317,2.465,0];
autorote_boo = true;
break;
case 81 ://q
poz_array[3] += 2/(Math.PI*10);
autorote_boo = true;
break;
case 87 ://w
poz_array[4] += 2/(Math.PI*10);
autorote_boo = true;
break;
case 69 ://e
poz_array[5] += 2/(Math.PI*10);
autorote_boo = true;
break;
case 65 ://a
poz_array[3] -= 2/(Math.PI*10);
autorote_boo = true;
break;
case 83 ://s
poz_array[4] -= 2/(Math.PI*10);
autorote_boo = true;
break;
case 68 ://d
poz_array[5] -= 2/(Math.PI*10);
autorote_boo = true;
break;
case 90 ://z
dotlinecount_num += 2;
return;
break;
/*
case 88 ://x
0,-60,470,-2.424,0,2.769
break;
*/
case 67 ://c
currentpoz_num = 99;
poz_array = [0,0,500,0,0,0];
break;
/*
case 86 ://v
65,-220,520,-1.240,-0.031,0.572
break;
*/
case 66 ://b
//trace(msg_array.length , msgcount_num)
msgcount_num ++;
if(msg_array.length > msgcount_num){
currentpoz_num = msgcount_num;
poz_array = msgpoz_array[currentpoz_num].concat();
autorote_boo = true;
}else{
currentpoz_num = 99;
poz_array = [0,0,500,0,0,0];
}
break;
case 78 ://n
poz_array = [0,0,300,0,0,0];
break;
case 77 ://m
poz_array = [0,0,-700,0,0,0];
break;
case 82 :
poz_array = [-335,-120,475,0,0,0];
break;
case 84 :
poz_array = [-430,-150,645,-1.082,0,0];
break;
case 89 :
poz_array = [-65,15,-75,3.455,3.596,2.864];
break;
case 85 :
poz_array = [-80,75,165,5.493,6.842,6.302];
break;
case 73 :
poz_array = [0,95,-15,-1.05,0,0];
break;
case 79 :
poz_array = [0,-60,470,3.424,3.596,2.769];
break;
case 70 :
poz_array = [30,-200,500,-1,0,0];
break;
case 71 :
poz_array = [135,90,-15,-1.227,-0.668,0];
break;
case 72 :
poz_array = [-285,110,-15,-1.227,-0.368,0];
break;
case 74 :
poz_array = [-450,130,-400,-1.227,0.236,0.031];
break;
case 75 :
poz_array = [0,0,1000,0,0,0];
break;
case 76 :
poz_array = [-75,-50,-110,-1.114,-0.0318,-1.973];
break;
default :
return;
break;
}
fc_startint();
}
var i:int;
var sprits:Array = new Array();
for (i = 0 ; i < origin_array.length*2;i++) {
var mc:Sprite = new Sprite();
this.addChild(mc);
mc.x = stageWidth/2;//320;
mc.y = stageHeight/2;//240;
sprits.push(mc);
}
///
var txtsprits:Array = new Array();
for(i = 0; i<txt_array.length*2;i++){
var tmc:TextField =new TextField();
tmc.autoSize = TextFieldAutoSize.LEFT;
tmc.multiline = true;
tmc.selectable = false;
this.addChild(tmc);
var fmt:TextFormat = new TextFormat();
fmt.size = 24;
tmc.setTextFormat(fmt);
txtsprits.push(tmc);
}
///
var sq_array:Array = new Array();
function fc_create(arg_array:Array):void{
//map
var data_array:Array = new Array();
data_array = Math3D.fc_arraycopy(origin_array).concat(Math3D.fc_arraycopy(origin_array));
//affine
var _array:Array = new Array();
_array[0] = Math.cos(arg_array[3]);
_array[1] = Math.sin(arg_array[3]);
_array[2] = Math.cos(arg_array[4]);
_array[3] = Math.sin(arg_array[4]);
_array[4] = Math.cos(arg_array[5]);
_array[5] = Math.sin(arg_array[5]);
_array[6] = arg_array[0];
_array[7] = arg_array[1];
_array[8] = arg_array[2];
for (var i:int = 0; i<data_array.length; i++) {
for (var j:int = 0; j<data_array[i][2].length; j++) {
data_array[i][2][j] = Math3D.fc_affine(data_array[i][2][j][0], data_array[i][2][j][1], data_array[i][2][j][2], _array);
if(i >= data_array.length/2){
data_array[i][2][j][0] += 18;
data_array[i][1][1] = 0xcc0000;
}else{
data_array[i][2][j][0] -= 18;
data_array[i][1][1] = 0x0000ff;
}
}
}
///cut
var dispcount_num:int = new int(0);
var vp_difference_num:Number = new Number(vpcutpoint_num-Math3D.vp_num);
for (i = 0; i<data_array.length; i++) {
var ar_array:Array= new Array();
for (j = 0; j<data_array[i][2].length; j++) {
if (data_array[i][2][j][2]<vp_difference_num) {
for (var k:int = 0; k<2; k++) {
var m:int = (data_array[i][2].length-1+j+2*k)%data_array[i][2].length;
var n:int = j%data_array[i][2].length;
if (data_array[i][2][m][2]>vp_difference_num) {
var n_wariai:Number = (vp_difference_num-data_array[i][2][n][2])/(data_array[i][2][m][2]-data_array[i][2][n][2]);
var n_repointx:Number = (data_array[i][2][m][0]-data_array[i][2][n][0])*n_wariai+data_array[i][2][n][0];
var n_repointy:Number = (data_array[i][2][m][1]-data_array[i][2][n][1])*n_wariai+data_array[i][2][n][1];
ar_array.push([n_repointx, n_repointy, vp_difference_num]);
}
}
} else {
ar_array.push(data_array[i][2][j]);
}
}
if(ar_array.length < 1){
data_array[i][1][0] = "cut";
}else{
data_array[i][2] = ar_array.concat();
}
}
///pertrance
for (i = 0; i<data_array.length; i++) {
if(data_array[i][1][0] == "cut"){
continue;
}
for (j = 0; j<data_array[i][2].length; j++) {
data_array[i][2][j] = Math3D.fc_pertrans(data_array[i][2][j]);
if(data_array[i][1][1] == 0xcc0000){
data_array[i][2][j][0] -= 15;
}else{
data_array[i][2][j][0] += 15;
}
}
}
//render
for (i =0;i < mcnum_num; i++) {
var mc:Sprite = Sprite(sprits[i]);
mc.graphics.clear();
}
// Spriteインスタンスへの矩形の描画
for (i = 0; i<data_array.length; i++) {
mc= Sprite(sprits[i]);
if(data_array[i][1][0] == "cut"){
continue;
}
mcnum_num = data_array.length;
if(data_array[i][1][0] == "txt"){
var _mc:TextField;
if(data_array[i][1][1] == 0xcc0000){
_mc= txtsprits[0+2*data_array[i][1][3]];
}else{
_mc= txtsprits[1+2*data_array[i][1][3]];
}
if((msg_boo && currentpoz_num == data_array[i][1][3]) || currentpoz_num == 99){
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = data_array[i][1][1];
_mc.visible = true;
_mc.htmlText = msg_array[data_array[i][1][3]];
_mc.x = data_array[i][2][0][0]+initStageWidth/2;
_mc.y = data_array[i][2][0][1]+initStageHeight/2;
_mc.scaleX = data_array[i][2][0][2]/10;
_mc.scaleY = data_array[i][2][0][2]/10;
_mc.setTextFormat(my_fmt);
_mc.blendMode = BlendMode.SCREEN;
}else{
_mc.visible = false;
mc.graphics.beginFill(data_array[i][1][1],1);
mc.graphics.drawCircle(data_array[i][2][0][0],data_array[i][2][0][1],data_array[i][2][0][2]);
mc.blendMode = BlendMode.SCREEN;
}
}else if(data_array[i][1][0] == "ball"){
mc.graphics.beginFill(data_array[i][1][1],1);
mc.graphics.drawCircle(data_array[i][2][0][0],data_array[i][2][0][1],data_array[i][2][0][2]);
mc.blendMode = BlendMode.SCREEN;
}else if(data_array[i][1][0] == "dotline"){
if(dotlinecount_num/10 < data_array[i][1][2]){
mc.graphics.lineStyle(1,data_array[i][1][1],0);
}else if(dotlinecount_num/10 > data_array[i][1][2]+0.9){
mc.graphics.lineStyle(1,data_array[i][1][1],1);
}else{
mc.graphics.lineStyle(1,data_array[i][1][1],(dotlinecount_num/10)%1);
}
mc.graphics.moveTo(data_array[i][2][0][0],data_array[i][2][0][1]);
for (j = 1; j<data_array[i][2].length; j++) {
mc.graphics.lineTo(data_array[i][2][j][0],data_array[i][2][j][1]);
}
mc.graphics.lineStyle(1,data_array[i][1][1],1);
mc.graphics.drawCircle(data_array[i][2][0][0],data_array[i][2][0][1],data_array[i][2][0][2]/3);
mc.graphics.drawCircle(data_array[i][2][data_array[i][2].length-1][0],data_array[i][2][data_array[i][2].length-1][1],data_array[i][2][data_array[i][2].length-1][2]/3);
mc.blendMode = BlendMode.SCREEN;
}else{
mc.graphics.lineStyle(1,data_array[i][1][1],1);
//mc.graphics.beginFill(data_array[i][1][1]);
mc.graphics.moveTo(data_array[i][2][0][0],data_array[i][2][0][1]);
for (j = 1; j<data_array[i][2].length; j++) {
mc.graphics.lineTo(data_array[i][2][j][0],data_array[i][2][j][1]);
}
mc.graphics.lineTo(data_array[i][2][0][0],data_array[i][2][0][1]);
mc.blendMode = BlendMode.SCREEN;
}
}
}
var animecount_num:int = new int(1);
var anime_array:Array = new Array(0,0,0,0,0,0);
var animestep_num:int = new int(60);
function fc_animator():void {
if(animecount_num < animestep_num){
for (var i:int = 0; i<poz_array.length; i++) {
anime_array[i] = anime_array[i]*(animestep_num-animecount_num)/animestep_num+poz_array[i]*animecount_num/animestep_num;
}
animecount_num ++;
if(animecount_num < animestep_num-25){
msg_boo = false;
}else{
msg_boo = true;
}
}else if(autorote_boo){
return;
}else{
anime_array[4] += (root.mouseX-initStageWidth/2)/25000;
anime_array[5] -= (root.mouseY-initStageHeight/2)/12500;
//animecount_num = 1;
//trace("comp");
//clearInterval(my_timedProcess);
fc_pozset("auto");
}
anime_array[3] %= Math.PI*2;
anime_array[4] %= Math.PI*2;
anime_array[5] %= Math.PI*2;
fc_create(anime_array);
}
var autorote_boo:Boolean = new Boolean(false);
var msg_boo:Boolean = new Boolean(false);
var my_timedProcess:uint;
function fc_startint():void {
animecount_num = 1;
}
addEventListener(Event.ENTER_FRAME,fc_animator);
fc_startint();
//フルスクリーンボタン
fullScreenBtn.graphics.beginFill(0x333333);
fullScreenBtn.graphics.drawRect(0,0,70,14);
var fullScreenTf:TextField = new TextField();
fullScreenTf.text = "FullScreen";
fullScreenTf.textColor = 0x666666;
fullScreenTf.selectable = false;
fullScreenBtn.addChild(fullScreenTf);
fullScreenBtn.x = stageWidth-70;
fullScreenBtn.addEventListener(MouseEvent.MOUSE_UP,MOUSE_UP);
addChild(fullScreenBtn);
}
private function MOUSE_UP(e:MouseEvent = null):void{
if(stage.displayState == "normal"){
stage.displayState = "fullScreen";
}else{
stage.displayState = "normal";
}
stageWidth = stage.stageWidth;
stageHeight = stage.stageHeight;
fullScreenBtn.x = (stageWidth-initStageWidth)/2+initStageWidth-70;
fullScreenBtn.y = -(stageHeight-initStageHeight)/2;
}
///////
}
}
class Math3D
{
static public var vp_num:Number = 450;
static public function fc_pertrans(arg_array:Array):Array {
var _per:Number = vp_num/(vp_num+arg_array[2]);
return [arg_array[0]*_per, arg_array[1]*_per, _per*20];
}
static public function fc_affine(x:Number, y:Number, z:Number, arg_array:Array):Array {
var n_cx:Number = arg_array[0];
var n_sx:Number = arg_array[1];
var n_cy:Number = arg_array[2];
var n_sy:Number = arg_array[3];
var n_cz:Number = arg_array[4];
var n_sz:Number = arg_array[5];
var _array:Array = new Array();
_array[0] = x*(n_cz*n_cy+n_sy*n_sx*n_sz)+y*(-n_sz*n_cy+n_sy*n_sx*n_cz)+z*(n_sy*n_cx)+arg_array[6];
_array[1] = x*(n_cx*n_sz)+y*n_cx*n_cz-z*(n_sx)+arg_array[7];
_array[2] = x*(-n_sy*n_cz+n_cy*n_sx*n_sz)+y*(n_sy*n_sz+n_cy*n_sx*n_cz)+z*(n_cy*n_cx)+arg_array[8];
return _array;
}
static public function fc_arraycopy(copy_array:Array):Array {
var _array:Array = new Array();
var i_array:Array = new Array();
for(var i:int= 0;i<copy_array.length;i++){
i_array[0] = copy_array[i][0];
i_array[1] = copy_array[i][1].concat();
var j_array:Array = new Array();
for(var j:int= 0;j<copy_array[i][2].length;j++){
j_array[j] = copy_array[i][2][j].concat();
}
i_array[2] = j_array.concat();
_array[i] = i_array.concat();
}
return _array;
}
}
[/sourcecode]