观看效果: (1)复制粘贴到一个新建的文本文件里。 (2)改扩展名为html。 注意事项: (1)VBScript目前只能在IE浏览器下运行。 (2)某些版本的IE会提示安全警告信息,请选择“允许阻止的内容” <html> <head> <title>K.G Script3D 3.00 - 霓虹灯(旋转的雕像)</title> </head> <body bgcolor="#000000" text="#FFFFFF"> <p id="idText" style="color:rgb(255,255,255)"></p> <p id="idInsertObject"></p> </body> <script language="VBScript" type="text/VBScript"> 'CSDN KiteGirl 原创 Dim pubS_Pix_x, pubS_Pix_y, pubS_Pix_z Dim pubS_Pix_cr, pubS_Pix_cg, pubS_Pix_cb Dim pubD_Mx, pubD_My, pubD_Mz Dim pubD_Rx, pubD_Ry, pubD_Rz Dim pubD_Mtx_Mx, pubD_Mtx_Mr Dim pubD_Pix_x, pubD_Pix_y, pubD_Pix_z, pubD_Pix_s Dim pubF_Va, pubF_Vd Dim pubV_Vx, pubV_Vy, pubV_Vz, pubV_Sc Dim pubV_Mtx_Mx, pubV_Mtx_Mr Dim pubV_Pix_x, pubV_Pix_y, pubV_Pix_z Dim pubElm, pubElm_Len Dim pubWeb_Tv, pubWeb_Tw Dim pubWeb_WW, pubWeb_WH Dim pubWeb_FontSize Dim pubLg Dim pubR, pubG, pubB Dim pubOR, pubOG, pubOB Sub window_onload() MakeModule With document.body pubWeb_WW = .clientWidth pubWeb_WH = .clientHeight End With pubD_Rz = 0 pubD_Rx = 45 pubD_Ry = 0 pubF_Va = 15 pubF_Vd = 40 pubV_Vx = pubWeb_WW / 2 pubV_Vy = pubWeb_WH * 1.2 / 2 pubV_Vz = 0 pubV_Sc = 10 pubWeb_Tw = 33 pubWeb_FontSize = 5 pubD_Mx = 0 pubD_My = 0 pubD_Mz = 0 MTX_3DMixV pubV_Vx, pubV_Vy, pubV_Vz, pubV_Sc, pubV_Mtx_Mx, pubV_Mtx_Mr Web_TimeLoop End Sub Sub MakeModule pubElm_Len = 919 pubElm = ELM_Create(pubElm_Len) ReDim pubS_Pix_x(pubElm_Len), pubS_Pix_y(pubElm_Len), pubS_Pix_z(pubElm_Len) ReDim pubS_Pix_cr(pubElm_Len), pubS_Pix_cg(pubElm_Len), pubS_Pix_cb(pubElm_Len) ReDim pubD_Pix_x(pubElm_Len), pubD_Pix_y(pubElm_Len), pubD_Pix_z(pubElm_Len) ReDim pubD_Pix_s(pubElm_Len), pubLg(pubElm_Len) ReDim pubV_Pix_x(pubElm_Len), pubV_Pix_y(pubElm_Len), pubV_Pix_z(pubElm_Len) tH = 100 tR = 0 For tI = 1 To 1500 Step 15 tR = tR + 0.1 tA = tA + (5 / tR * 2 * 3.14) tH = 30 - 5 * tR '2 * tR tAr = Radian(tA) tX = Sin(tAr) * tR * 3 tY = Cos(tAr) * tR * 3 For tZ = Int(tH) To 0 Step -1 pubLg(tAdd) = tZ / (Int(tH) + 1) pubS_Pix_x(tAdd) = tX pubS_Pix_y(tAdd) = tY pubS_Pix_z(tAdd) = tZ tAdd = tAdd + 1 Next Next End Sub Sub Web_TimeLoop() pubD_Rz = Int(Timer * 100 Mod 6000) * 6 / 100 If pubD_Rx > -45 Then pubD_Rx = pubD_Rx - 0.5 pubD_Ry = 0 MTX_3DMixD pubD_Mx, pubD_My, pubD_Mz, pubD_Rx, pubD_Ry, pubD_Rz, pubD_Mtx_Mx, pubD_Mtx_Mr PXE_MTXTram3D pubS_Pix_x, pubS_Pix_y, pubS_Pix_z, pubD_Mtx_Mx, pubD_Mtx_Mr, pubD_Pix_x, pubD_Pix_y, pubD_Pix_z FIT_PSV pubD_Pix_x, pubD_Pix_y, pubD_Pix_z, pubF_Va, pubF_Vd, pubD_Pix_x, pubD_Pix_y, pubD_Pix_z, pubD_Pix_s PXE_MTXTram3D pubD_Pix_x, pubD_Pix_y, pubD_Pix_z, pubV_Mtx_Mx, pubV_Mtx_Mr, pubV_Pix_x, pubV_Pix_y, pubV_Pix_z For tI = 0 To 10 For tEi = pubElm_Len To 0 Step -1 If CBool(tEi) Then pubS_Pix_cr(tEi) = pubS_Pix_cr(tEi - 1) pubS_Pix_cg(tEi) = pubS_Pix_cg(tEi - 1) pubS_Pix_cb(tEi) = pubS_Pix_cb(tEi - 1) Else ValueMove pubR, pubOR ValueMove pubG, pubOG ValueMove pubB, pubOB If pubR = pubOR And pubB = pubOB And pubG = pubOG Then pubOR = Int(Rnd * 128) + 127 pubOG = Int(Rnd * 128) + 127 pubOB = Int(Rnd * 128) + 127 End If pubS_Pix_cr(tEi) = pubR pubS_Pix_cg(tEi) = pubG pubS_Pix_cb(tEi) = pubB End If Next Next For tEi = pubElm_Len To 0 Step -1 With pubElm(tEi).style .left = pubV_Pix_x(tEi) .top = pubV_Pix_y(tEi) .zindex = pubD_Pix_z(tEi) + 100 .backgroundcolor = rgb(pubS_Pix_cr(tEi) * pubLg(tEi), pubS_Pix_cg(tEi) * pubLg(tEi), pubS_Pix_cb(tEi) * pubLg(tEi)) .width = pubD_Pix_s(tEi) * pubWeb_FontSize & "px" .height = .width End With Next pubWeb_Tv = window.setTimeout("Web_TimeLoop", pubWeb_Tw) End Sub Sub ValueMove(pV, pVo) If pV < pVo Then pV = pV + 1 If pV > pVo Then pV = pV - 1 End Sub Function ELM_Create(pEn) ReDim tElms(pEn) For tEi = 0 To pEn With document Set tElms(tEi) = .createElement("DIV") .body.insertAdjacentElement "beForeEnd", tElms(tEi) End With With tElms(tEi) .style.position = "absolute" .style.backgroundcolor = rgb(255,255,255) .style.fontsize = 0 .style.width = 10 .style.height = 10 End With Next ELM_Create = tElms End Function 'PXE Sub PXE_MTXTram3D(pPx(), pPy(), pPz(), pM(), pMr(), oPx(), oPy(), oPz()) tPe = UBound(pPx) For tPi = 0 To tPe oPx(tPi) = pPx(tPi) * pM(0) + pPy(tPi) * pM(1) + pPz(tPi) * pM(2) + pM(3) oPy(tPi) = pPx(tPi) * pM(4) + pPy(tPi) * pM(5) + pPz(tPi) * pM(6) + pM(7) oPz(tPi) = pPx(tPi) * pM(8) + pPy(tPi) * pM(9) + pPz(tPi) * pM(10) + pM(11) Next End Sub 'FIT Sub FIT_PSV(iPx, iPy, iPz, iVa, iVd, oPx, oPy, oPz, oPs) tPe = UBound(iPx) For tPi = 0 To tPe tZ = iPz(tPi) + iVd oPs(tPi) = tZ / iVd oPx(tPi) = iPx(tPi) * oPs(tPi) oPy(tPi) = iPy(tPi) * oPs(tPi) oPz(tPi) = iPz(tPi) Next End Sub 'MTX Sub MTX_3DMixD(iMx, iMy, iMz, iRx, iRy, iRz, oMx, oMr) MTX_3DPixMove tMtx_MV, oMr, iMx, iMy, iMz MTX_3DPixRotZ tMtx_RTz, oMr, iRz MTX_3DPixRotX tMtx_RTx, oMr, iRx MTX_3DPixRotY tMtx_RTy, oMr, iRy MTX_Multi tMtx_MV, oMr, tMtx_RTz, oMr, tMx, oMr oMx = tMx MTX_Multi oMx, oMr, tMtx_RTx, oMr, tMx, oMr oMx = tMx MTX_Multi oMx, oMr, tMtx_RTy, oMr, tMx, oMr oMx = tMx End Sub Sub MTX_3DMixV(iVx, iVy, iVz, iSc, oMx, oMr) MTX_3DPixMulti tMtx_SC, oMr, iSc MTX_3DPixMove tMtx_VM, oMr, iVx, iVy, iVz MTX_Multi tMtx_SC, oMr, tMtx_VM, oMr, tMx, oMr oMx = tMx End Sub Sub MTX_3DPixMulti(oM(), oMr, iSc) oMr = 4 ReDim oM(15) oM = Array(iSc, 0, 0, 0, 0, iSc, 0, 0, 0, 0, iSc, 0, 0, 0, 0, 1) End Sub Sub MTX_3DPixMove(oM(), oMr, iMx, iMy, iMz) oMr = 4 ReDim oM(15) oM = Array(1, 0, 0, iMx, 0, 1, 0, iMy, 0, 0, 1, iMz, 0, 0, 0, 1) End Sub Sub MTX_3DPixRotZ(oM(), oMr, iA) oMr = 4 ReDim oM(15) tR = Radian(iA) : tSin = sin(tR) : tCos = cos(tR) oM = Array(tCos, -tSin, 0, 0, tSin, tCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) End Sub Sub MTX_3DPixRotY(oM(), oMr, iA) oMr = 4 ReDim oM(15) tR = Radian(iA) : tSin = sin(tR) : tCos = cos(tR) oM = Array(tCos, 0, tSin, 0, 0, 1, 0, 0, -tSin, 0, tCos, 0, 0, 0, 0, 1) End Sub Sub MTX_3DPixRotX(oM(), oMr, iA) oMr = 4 tR = Radian(iA) : tSin = sin(tR) : tCos = cos(tR) oM = Array(1, 0, 0, 0, 0, tCos, tSin, 0, 0, -tSin, tCos, 0, 0, 0, 0, 1) End Sub Sub MTX_Multi(iMa(), iMar, iMb(), iMbr, oMc(), oMcr) tN = (iMar = ((UBound(iMb) / iMbr) + 1)) And (iMar - 1) If CBool(tN) Then tM = Ubound(iMa) / iMar tP = iMbr - 1 oMcr = tP + 1 ReDim oMc(oMcr * (tM + 1) - 1) For tMi = 0 To tM For tPi = 0 To tP For tNi = 0 To tN tMv = MTX_VGet(oMc, oMcr, tMi, tPi) + MTX_VGet(iMa, iMar, tMi, tNi) * MTX_VGet(iMb, iMbr, tNi, tPi) MTX_VSet oMc, oMcr, tMi, tPi, tMv Next Next Next End If End Sub Sub MTX_GetByTxt(iT, oM(), oMr) tLs = Split(iT, "|") tLe = Ubound(tLs) For tLi = 0 To tLe Next End Sub Sub MTX_VSet(pM(), pMr, pX, pY, pMv) tMi = pY * pMr + pX pM(tMi) = pMv End Sub Function MTX_VGet(pM(), pMr, pX, pY) tMi = pY * pMr + pX MTX_VGet = pM(tMi) End Function Function Radian(pA) Radian = pA * 71 / 4068 End Function </script> </html>