发信人: yasho()
整理人: morefeetin(2000-01-04 16:40:41), 站内信件
|
If Frame Is Loaded ("end")
Go to and Play ("start")
End Frame Loaded
initalise:
Comment:
Comment: 初始化全局变量
Set Variable: "pi" = 3 .1415
Set Variable: "worldRotX" = .496 //初始化旋转度
Set Variable: "worldRotY" = 5 .267
Set Variable: "centerx" = 160 //3D中心的X,Y位置
Set Variable: "centery" = 180
// 设置点的3D坐标值 用 ,分割XYZ R分割各个点
Set Variable: "ptsetstringA" = "40,40,-40R-40,40,-40R-40,-40,-40R40,-4 0,-40R40,40,40R-40,40,40R-40,-40,40R40,-40,40R"
Set Variable: "numberofpts" = 8 //点数
Start Drag ("/drag", lockcenter)
Comment:
Comment: 设置点位置
Set Variable: "inptsetstring" = ptsetstringA
Set Variable: "inshapename" = "cube"
Set Variable: "innumberofpts" = numberofpts
Call ("make matrix") //返回各个点的3D坐标如 cobe_01_x=50
// cobe_01_y=50
// cobe_01_z=-50
Comment:
Comment: 生成其余的光球
Set Variable: "counter" = 1
Loop While (counter <> numberofpts)
Set Variable: "counter" = counter + 1
Duplicate Movie Clip ("light1", "light" & counter, counter + 10)
End Loop
display stars:
Comment:
Comment: 获取当前鼠标位置
Set Variable: "Xm" = GetProperty ("/drag",_x)
Set Variable: "Ym" = GetProperty ("/drag",_y)
Comment: 获取当前跟踪位置
Set Variable: "Xf" = centerx
Set Variable: "Yf" = centery
Comment: 计算间隔并由加速度计算当前位置
Set Variable: "Sx" = Xm-Xf
Set Variable: "Sy" = Ym-Yf
Set Variable: "Xnew" = Xf+(Sx/50)
Set Variable: "Ynew" = Yf+(Sy/50)
Comment:
Comment: 设置旋转度
Comment:
Set Variable: "worldRotX" = worldRotX + (((Ym - Yf) /300)*0 .5)
// 根据鼠标位移来改变旋转度
If (worldRotX>(2*pi))
Set Variable: "worldRotX" = worldRotX-(2*pi)
End If
If (worldRotX<0)
Set Variable: "worldRotX" = worldRotX+(2*pi)
End If
Set Variable: "worldRotY" = worldRotY - (((Xm-Xf)/400)*0 .5)
// 根据鼠标位移来改变旋转度
If (worldRotY>(2*pi))
Set Variable: "worldRotY" = worldRotY-(2*pi)
End If
If (worldRotY<0)
Set Variable: "worldRotY" = worldRotY+(2*pi)
End If
Call ("spinXY") //获取转换后新点的3D坐标
// ? 如 cube_01_tx; cube_01_ty; cube_01_tz
Comment:
Comment: 画光球
Comment:
Set Variable: "counter" = 0
Loop While (counter <> numberofpts)
Set Variable: "counter" = counter + 1
Set Variable: "lightnum" = "0"&counter
Set Variable: "WhichLight" = "light" & counter
Call ("display light") //画出光球
End Loop
Set Variable: "centerx" = Xnew
Set Variable: "centery" = Ynew
loop back:
Go to and Play ("display stars")
spinXY:
If (worldRotX>0)
Set Variable: "tmpX" = worldRotX
Set Variable: "tmpX" = Substring(tmpX,1,1) & Substring(tmpX,3,2)
Set Variable: "sinX" = eval("/sin:sin"&tmpX)
Else
Set Variable: "tmpX" = worldRotX
Set Variable: "tmpX" = Substring(tmpX,2,1) & Substring(tmpX,4,2)
Set Variable: "sinX" = 0 - eval("/sin:sin"&tmpX)
End If
If (worldRotY>0)
Set Variable: "tmpY" = (worldRotY +10 .0001)
Set Variable: "tmpY" = Substring(tmpY,2,1) & Substring(tmpY,4,2)
Set Variable: "sinY" = eval("/sin:sin"&tmpY)
Else
Set Variable: "tmpY" = (worldRotY -10 .0001)
Set Variable: "tmpY" = Substring(tmpY,3,1) & Substring(tmpY,5,2)
Set Variable: "sinY" = 0 - eval("/sin:sin"&tmpY)
End If
Set Variable: "cosX" = eval("/cos:cos"&tmpX)
Set Variable: "cosY" = eval("/cos:cos"&tmpY)
Set Variable: "counter" = 0
Loop While (counter <> numberofpts)
Set Variable: "counter" = counter + 1
Set Variable: "in" = counter
If (length(in) = 1)
Set Variable: "in" = "0" & in
End If
// 根据旋转角度算出新的3D坐标
Set Variable: "tmp_zpos" = eval("cube_"&in&"_z") * cosY - eval("cube_" &in&"_x") * sinY
Set Variable: "cube_"&in&"_tx" = eval("cube_"&in&"_z") * sinY + eval(" cube_"&in&"_x") * cosY
Set Variable: "cube_"&in&"_tz" = eval("cube_"&in&"_y") * sinX + tmp_zp os * cosX
Set Variable: "cube_"&in&"_ty" = eval("cube_"&in&"_y") * cosX - tmp_zp os * sinX
End Loop
display line:
Call ("make 2d pointset") //根据3D坐标算出2D的x,y位置
Set Variable: "tmpAlpha" = eval("cube_"&eval("lightnum")&"_fa") //获得 点的透明度
If (tmpAlpha > 12)
Set Property (WhichLight, Alpha) = tmpAlpha
Set Property (WhichLight, X Scale) = tmpAlpha //光球的放大倍数=透明度
Set Property (WhichLight, Y Scale) = tmpAlpha
Set Property (WhichLight, X Position) = eval("cube_"&eval("lightnum")& "_fx")
Set Property (WhichLight, Y Position) = eval("cube_"&eval("lightnum")& "_fy")
Set Property (WhichLight, Visibility) = 1
Else
Set Property (WhichLight, Visibility) = 0
End If
make 2d pointset:
Set Variable: "scalar" = (1 / (eval( "cube_"&lightnum&"_tz" ) / 300+ 1 ))
// z坐标影响线的深度
Set Variable: "xp" = scalar * eval("cube_"&lightnum&"_tx")
Set Variable: "yp" = scalar * eval("cube_"&lightnum&"_ty")
Set Variable: "cube_"&lightnum&"_fx" = xp + Xnew
Set Variable: "cube_"&lightnum&"_fy" = yp + Ynew
Set Variable: "cube_"&lightnum&"_fa" = ((scalar - .7 ) * 133)+20
// 由深度取得透明度
make matrix:
Comment:
Comment: 设置点的3D坐标
Comment: 用 ,分割XYZ R分割各个点
Set Variable: "whichOne" = 1
Set Variable: "whichchar" = 0
Set Variable: "tmpstring" = ""
Loop While (whichOne <> (innumberofpts+1))
Set Variable: "letter" = whichOne
If (Length ( letter ) = 1)
Set Variable: "letter" = "0" & letter
End If
Set Variable: "whichXYZ" = "x"
Set Variable: "loopy" = "0"
Loop While (loopy <> 1)
Set Variable: "whichchar" = whichchar + 1
If (Ord(substring(inptsetstring,whichchar,1)) = 82)
Set Variable: "loopy" = 1
Set Variable: "whichOne" = whichOne + 1
Else If (Ord(substring(inptsetstring,whichchar,1)) = 44)
Set Variable: "tmpstring" = ""
If (whichXYZ eq "x")
Set Variable: "whichXYZ" = "y"
Else If (whichXYZ eq "y")
Set Variable: "whichXYZ" = "z"
End If
Else
Set Variable: "tmpstring" & whichXYZ = eval("tmpstring"&whichXYZ) & su bstring(inptsetstring,whichchar,1)
End If
End Loop
Set Variable: inshapename&"_"&letter&"_x" = tmpstringx
Set Variable: inshapename&"_"&letter&"_y" = tmpstringy
Set Variable: inshapename&"_"&letter&"_z" = tmpstringz
Set Variable: "tmpstringx" = ""
Set Variable: "tmpstringy" = ""
Set Variable: "tmpstringz" = ""
End Loop
MC sin: //从字符串中取出sin值
Set Variable: "thetext" = "0 .0000 .0100 .0200 .0300 .0400 .0500 .0600 .0690 .0790 .0890 .0990 .1090 .1190 .1290 .1390 .1490 .1590 .1690 .17 90 .1880 .1980 .2080 .2180 .2280 .2370 .2470 .2570 .2660 .2760 .2860 . 2950 .3050 .3140 .3240 .3330 .3420 .3520 .3610 .3700 .3800 .3890 .3980 .4070 .4160 .4250 .4350 .4430 .4520 .4610 .4700 .4790 .4880 .4960 .50 50 .5140 .5220 .5310 .5390 .5480 .5560 .5640 .5720 .5810 .5890 .5970 . 6050 .6130 .6210 .6280 .6360 .6440 .6510 .6590 .6660 .6740 .6810 .6880 .6960 .7030 .7100 .7170 .7240 .7310 .7370 .7440 .7510 .7570 .7640 .77 00 .7770 .7830 .7890 .7950 .8010 .8070 .8130 .8190 .8240 .8300 .8360 . 8410 .8460 .8520 .8570 .8620 .8670 .8720 .8770 .8820 .8860 .8910 .8950 .9000 .9040 .9080 .9120 .9160 .9200 .9240 .9280 .9320 .9350 .9390 .94 20 .9450 .9490 .9520 .9550 .9580 .9600 .9630 .9660 .9680 .9710 .9730 . 9750 .9770 .9790 .9810 .9830 .9850 .9870 .9880 .9900 .9910 .9920 .9930 .9940 .9950 .9960 .9970 .9980 .9980 .9990 .9990 .9990 .9991 .0001 .00 00 .9990 .9990 .9990 .9980 .9980 .9970 .9960 .9960 .9950 .9940 .9920 . 9910 .9900 .9880 .9870 .9850 .9840 .9820 .9800 .9780 .9760 .9730 .9710 .9690 .9660 .9640 .9610 .9580 .9550 .9520 .9490 .9460 .9430 .9390 .93 60 .9320 .9290 .9250 .9210 .9170 .9130 .9090 .9050 .9000 .8960 .8910 . 8870 .8820 .8780 .8730 .8680 .8630 .8580 .8520 .8470 .8420 .8360 .8310 .8250 .8200 .8140 .8080 .8020 .7960 .7900 .7840 .7780 .7710 .7650 .75 80 .7520 .7450 .7390 .7320 .7250 .7180 .7110 .7040 .6970 .6900 .6820 . 6750 .6680 .6600 .6530 .6450 .6370 .6300 .6220 .6140 .6060 .5980 .5900 .5820 .5740 .5660 .5570 .5490 .5410 .5320 .5240 .5150 .5060 .4980 .48 90 .4800 .4720 .4630 .4540 .4450 .4360 .4270 .4180 .4090 .4000 .3900 . 3810 .3720 .3630 .3530 .3440 .3350 .3250 .3160 .3060 .2970 .2870 .2770 .2680 .2580 .2480 .2390 .2290 .2190 .2100 .2000 .1900 .1800 .1700 .16 00 .1510 .1410 .1310 .1210 .1110 .1010 .0910 .0810 .0710 .0610 .0510 . 0410 .0310 .0210 .0110 .001-0 .00-0 .01-0 .02-0 .03-0 .04-0 .05-0 .06- 0 .07-0 .08-0 .09-0 .10-0 .11-0 .12-0 .13-0 .14-0 .15-0 .16-0 .17-0 .1 8-0 .19-0 .20-0 .21-0 .22-0 .23-0 .24-0 .25-0 .26-0 .27-0 .28-0 .29-0 .30-0 .31-0 .32-0 .33-0 .34-0 .35-0 .36-0 .36-0 .37-0 .38-0 .39-0 .40- 0 .41-0 .42-0 .43-0 .44-0 .45-0 .46-0 .46-0 .47-0 .48-0 .49-0 .50-0 .5 1-0 .52-0 .52-0 .53-0 .54-0 .55-0 .56-0 .57-0 .57-0 .58-0 .59-0 .60-0 .61-0 .61-0 .62-0 .63-0 .64-0 .65-0 .65-0 .66-0 .67-0 .68-0 .68-0 .69- 0 .70-0 .70-0 .71-0 .72-0 .73-0 .73-0 .74-0 .75-0 .75-0 .76-0 .76-0 .7 7-0 .78-0 .78-0 .79-0 .80-0 .80-0 .81-0 .81-0 .82-0 .82-0 .83-0 .84-0 .84-0 .85-0 .85-0 .86-0 .86-0 .87-0 .87-0 .88-0 .88-0 .89-0 .89-0 .89- 0 .90-0 .90-0 .91-0 .91-0 .92-0 .92-0 .92-0 .93-0 .93-0 .93-0 .94-0 .9 4-0 .94-0 .95-0 .95-0 .95-0 .96-0 .96-0 .96-0 .96-0 .97-0 .97-0 .97-0 .97-0 .97-0 .98-0 .98-0 .98-0 .98-0 .98-0 .98-0 .99-0 .99-0 .99-0 .99- 0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-1 .00-1 .00-0 .9 9-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .98-0 .98-0 .98-0 .98-0 .98-0 .98-0 .97-0 .97-0 .97-0 .97-0 .96- 0 .96-0 .96-0 .96-0 .95-0 .95-0 .95-0 .95-0 .94-0 .94-0 .94-0 .93-0 .9 3-0 .92-0 .92-0 .92-0 .91-0 .91-0 .91-0 .90-0 .90-0 .89-0 .89-0 .88-0 .88-0 .87-0 .87-0 .86-0 .86-0 .85-0 .85-0 .84-0 .84-0 .83-0 .83-0 .82- 0 .82-0 .81-0 .80-0 .80-0 .79-0 .79-0 .78-0 .77-0 .77-0 .76-0 .75-0 .7 5-0 .74-0 .74-0 .73-0 .72-0 .71-0 .71-0 .70-0 .69-0 .69-0 .68-0 .67-0 .66-0 .66-0 .65-0 .64-0 .63-0 .63-0 .62-0 .61-0 .60-0 .59-0 .59-0 .58- 0 .57-0 .56-0 .55-0 .55-0 .54-0 .53-0 .52-0 .51-0 .50-0 .49-0 .49-0 .4 8-0 .47-0 .46-0 .45-0 .44-0 .43-0 .42-0 .41-0 .41-0 .40-0 .39-0 .38-0 .37-0 .36-0 .35-0 .34-0 .33-0 .32-0 .31-0 .30-0 .29-0 .28-0 .27-0 .26- 0 .26-0 .25-0 .24-0 .23-0 .22-0 .21-0 .20-0 .19-0 .18-0 .17-0 .16-0 .1 5-0 .14-0 .13-0 .12-0 .11-0 .10-0 .09-0 .08-0 .07-0 .06-0 .05-0 .04-0 .03-0 .02-0 .01-0 .00"
Set Variable: "counter" = -1
Loop While (counter < 629)
Set Variable: "counter" = counter + 1
If (length(counter)=1)
Set Variable: "tmpName" = "sin"&"00"&counter
Else If (length(counter)=2)
Set Variable: "tmpName" = "sin"&"0"&counter
Else If (length(counter)=3)
Set Variable: "tmpName" = "sin"&counter
End If
Set Variable: tmpName = substring(thetext,(counter*5)+1,5)
End Loop
MC cos: //从字符串中取出cos值
Set Variable: "thetext" = "1 .0001 .0000 .9990 .9990 .9990 .9980 .9980 .9970 .9960 .9960 .9950 .9940 .9920 .9910 .9900 .9880 .9870 .9850 .98 30 .9820 .9800 .9780 .9750 .9730 .9710 .9680 .9660 .9630 .9610 .9580 . 9550 .9520 .9490 .9460 .9420 .9390 .9350 .9320 .9280 .9240 .9210 .9170 .9130 .9090 .9040 .9000 .8960 .8910 .8870 .8820 .8770 .8720 .8670 .86 20 .8570 .8520 .8470 .8410 .8360 .8300 .8250 .8190 .8130 .8080 .8020 . 7960 .7900 .7830 .7770 .7710 .7640 .7580 .7510 .7450 .7380 .7310 .7240 .7170 .7100 .7030 .6960 .6890 .6820 .6740 .6670 .6600 .6520 .6440 .63 70 .6290 .6210 .6130 .6050 .5970 .5890 .5810 .5730 .5650 .5570 .5480 . 5400 .5310 .5230 .5140 .5060 .4970 .4880 .4800 .4710 .4620 .4530 .4440 .4350 .4260 .4170 .4080 .3990 .3900 .3800 .3710 .3620 .3530 .3430 .33 40 .3240 .3150 .3050 .2960 .2860 .2770 .2670 .2570 .2480 .2380 .2280 . 2190 .2090 .1990 .1890 .1790 .1700 .1600 .1500 .1400 .1300 .1200 .1100 .1000 .0900 .0800 .0700 .0600 .0500 .0400 .0300 .0200 .0100 .000-0 .0 0-0 .01-0 .02-0 .03-0 .04-0 .05-0 .06-0 .07-0 .08-0 .09-0 .10-0 .11-0 .12-0 .13-0 .14-0 .15-0 .16-0 .17-0 .18-0 .19-0 .20-0 .21-0 .22-0 .23- 0 .24-0 .25-0 .26-0 .27-0 .28-0 .29-0 .30-0 .31-0 .32-0 .33-0 .34-0 .3 5-0 .36-0 .37-0 .37-0 .38-0 .39-0 .40-0 .41-0 .42-0 .43-0 .44-0 .45-0 .46-0 .46-0 .47-0 .48-0 .49-0 .50-0 .51-0 .52-0 .53-0 .53-0 .54-0 .55- 0 .56-0 .57-0 .58-0 .58-0 .59-0 .60-0 .61-0 .62-0 .62-0 .63-0 .64-0 .6 5-0 .65-0 .66-0 .67-0 .68-0 .68-0 .69-0 .70-0 .70-0 .71-0 .72-0 .73-0 .73-0 .74-0 .75-0 .75-0 .76-0 .77-0 .77-0 .78-0 .78-0 .79-0 .80-0 .80- 0 .81-0 .81-0 .82-0 .83-0 .83-0 .84-0 .84-0 .85-0 .85-0 .86-0 .86-0 .8 7-0 .87-0 .88-0 .88-0 .89-0 .89-0 .89-0 .90-0 .90-0 .91-0 .91-0 .92-0 .92-0 .92-0 .93-0 .93-0 .93-0 .94-0 .94-0 .94-0 .95-0 .95-0 .95-0 .96- 0 .96-0 .96-0 .96-0 .97-0 .97-0 .97-0 .97-0 .97-0 .98-0 .98-0 .98-0 .9 8-0 .98-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-1 .00-1 .00-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99- 0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .99-0 .98-0 .98-0 .98-0 .98-0 .9 8-0 .98-0 .97-0 .97-0 .97-0 .97-0 .96-0 .96-0 .96-0 .96-0 .95-0 .95-0 .95-0 .94-0 .94-0 .94-0 .93-0 .93-0 .93-0 .92-0 .92-0 .92-0 .91-0 .91- 0 .90-0 .90-0 .90-0 .89-0 .89-0 .88-0 .88-0 .87-0 .87-0 .86-0 .86-0 .8 5-0 .85-0 .84-0 .84-0 .83-0 .83-0 .82-0 .82-0 .81-0 .80-0 .80-0 .79-0 .79-0 .78-0 .77-0 .77-0 .76-0 .75-0 .75-0 .74-0 .73-0 .73-0 .72-0 .71- 0 .71-0 .70-0 .69-0 .69-0 .68-0 .67-0 .66-0 .66-0 .65-0 .64-0 .63-0 .6 3-0 .62-0 .61-0 .60-0 .59-0 .59-0 .58-0 .57-0 .56-0 .55-0 .55-0 .54-0 .53-0 .52-0 .51-0 .50-0 .49-0 .49-0 .48-0 .47-0 .46-0 .45-0 .44-0 .43- 0 .42-0 .41-0 .40-0 .40-0 .39-0 .38-0 .37-0 .36-0 .35-0 .34-0 .33-0 .3 2-0 .31-0 .30-0 .29-0 .28-0 .27-0 .26-0 .25-0 .24-0 .24-0 .23-0 .22-0 .21-0 .20-0 .19-0 .18-0 .17-0 .16-0 .15-0 .14-0 .13-0 .12-0 .11-0 .10- 0 .09-0 .08-0 .07-0 .06-0 .05-0 .04-0 .03-0 .02-0 .01-0 .000 .0070 .01 70 .0270 .0370 .0470 .0570 .0670 .0770 .0870 .0970 .1070 .1170 .1270 . 1370 .1470 .1570 .1660 .1760 .1860 .1960 .2060 .2150 .2250 .2350 .2450 .2540 .2640 .2740 .2830 .2930 .3020 .3120 .3210 .3310 .3400 .3500 .35 90 .3680 .3780 .3870 .3960 .4050 .4140 .4230 .4320 .4410 .4500 .4590 . 4680 .4770 .4860 .4940 .5030 .5120 .5200 .5290 .5370 .5460 .5540 .5620 .5700 .5790 .5870 .5950 .6030 .6110 .6190 .6260 .6340 .6420 .6500 .65 70 .6650 .6720 .6790 .6870 .6940 .7010 .7080 .7150 .7220 .7290 .7360 . 7430 .7490 .7560 .7620 .7690 .7750 .7810 .7880 .7940 .8000 .8060 .8120 .8170 .8230 .8290 .8340 .8400 .8450 .8500 .8560 .8610 .8660 .8710 .87 60 .8800 .8850 .8900 .8940 .8990 .9030 .9070 .9110 .9150 .9190 .9230 . 9270 .9310 .9340 .9380 .9410 .9450 .9480 .9510 .9540 .9570 .9600 .9620 .9650 .9680 .9700 .9720 .9750 .9770 .9790 .9810 .9830 .9850 .9860 .98 80 .9890 .9910 .9920 .9930 .9940 .9950 .9960 .9970 .9980 .9980 .9990 . 9990 .9990 .9991 .000"
Set Variable: "counter" = -1
Loop While (counter < 629)
Set Variable: "counter" = counter + 1
If (length(counter)=1)
Set Variable: "tmpName" = "cos"&"00"&counter
Else If (length(counter)=2)
Set Variable: "tmpName" = "cos"&"0"&counter
Else If (length(counter)=3)
Set Variable: "tmpName" = "cos"&counter
End If
Set Variable: tmpName = substring(thetext,(counter*5)+1,5)
End Loop
-- .\* . [] * __ --我好想在森林里有自己的小屋--
? */ . ./\~~~~~~~~~~~~'\. |◆
\* ,/,..,\,...........,\.◆
|| ..▎# ▎田 田 ▎ | ▎◆
|| &&▎ ▎ ▎'|'▎ o
|| ##■■■■■■■■■■〓▄▃▂▁
※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 202.103.177.98]
|
|