【编程游戏】贺岁霓虹灯。(参观288楼KiteGirl的霓虹灯,VBScript编写)时间:2021-02-16 20:40:09【编程游戏】贺岁霓虹灯。(第一名奖励10000可用分) 效果图 评分 参观 [目前Firefox中好使,其他浏览器需复制到本地,存为html文件看效果]<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 languate="VBScript" type="text/VBScript">'CSDN KiteGirl 原创Dim pubS_Pix_x, pubS_Pix_y, pubS_Pix_zDim pubS_Pix_cr, pubS_Pix_cg, pubS_Pix_cbDim pubD_Mx, pubD_My, pubD_MzDim pubD_Rx, pubD_Ry, pubD_RzDim pubD_Mtx_Mx, pubD_Mtx_MrDim pubD_Pix_x, pubD_Pix_y, pubD_Pix_z, pubD_Pix_sDim pubF_Va, pubF_VdDim pubV_Vx, pubV_Vy, pubV_Vz, pubV_ScDim pubV_Mtx_Mx, pubV_Mtx_MrDim pubV_Pix_x, pubV_Pix_y, pubV_Pix_zDim pubElm, pubElm_LenDim pubWeb_Tv, pubWeb_TwDim pubWeb_WW, pubWeb_WHDim pubWeb_FontSizeDim pubLgDim pubR, pubG, pubBDim pubOR, pubOG, pubOBSub window_onload()MakeModuleWith document.bodypubWeb_WW = .clientWidth pubWeb_WH = .clientHeight End With pubD_Rz = 0pubD_Rx = 0pubD_Ry = 0 pubF_Va = 15pubF_Vd = 60pubV_Vx = pubWeb_WW / 2pubV_Vy = pubWeb_WH / 2pubV_Vz = 0pubV_Sc = 10pubWeb_Tw = 33pubWeb_FontSize = 5pubD_Mx = -30pubD_My = -8pubD_Mz = 0MTX_3DMixV pubV_Vx, pubV_Vy, pubV_Vz, pubV_Sc, pubV_Mtx_Mx, pubV_Mtx_MrWeb_TimeLoopEnd SubSub MakeModulepubElm_Len = 960pubElm = 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)For tI = 0 To pubElm_LenpubS_Pix_y(tI) = tI / 60pubS_Pix_x(tI) = tI Mod 60tA = Radian(pubS_Pix_x(tI) * 12)pubS_Pix_z(tI) = pubS_Pix_y(tI) * Sin(tA) / 2pubLg(tI) = pubS_Pix_y(tI) / 16NextEnd SubSub Web_TimeLoop()'pubD_Rz = 45pubD_Rz = Int(Timer * 50 Mod 6000) * 6 / 100pubD_Rx = -45pubD_Ry = 0tWv = Int(Timer * 10) Mod 60For tI = 0 To pubElm_LenpubS_Pix_y(tI) = tI / 60pubS_Pix_x(tI) = tI Mod 60tX = (pubS_Pix_x(tI) + tWv) Mod 60tA = Radian(tX * 12)pubS_Pix_z(tI) = pubS_Pix_y(tI) * Sin(tA) / 2pubLg(tI) = pubS_Pix_y(tI) / 16NextMTX_3DMixD pubD_Mx, pubD_My, pubD_Mz, pubD_Rx, pubD_Ry, pubD_Rz, pubD_Mtx_Mx, pubD_Mtx_MrPXE_MTXTram3D pubS_Pix_x, pubS_Pix_y, pubS_Pix_z, pubD_Mtx_Mx, pubD_Mtx_Mr, pubD_Pix_x, pubD_Pix_y, pubD_Pix_zFIT_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_sPXE_MTXTram3D pubD_Pix_x, pubD_Pix_y, pubD_Pix_z, pubV_Mtx_Mx, pubV_Mtx_Mr, pubV_Pix_x, pubV_Pix_y, pubV_Pix_zFor tI = 0 To 10ValueMove pubR, pubORValueMove pubG, pubOGValueMove pubB, pubOBIf pubR = pubOR And pubB = pubOB And pubG = pubOG Then pubOR = Int(Rnd * 64) + 63pubOG = Int(Rnd * 64) + 63pubOB = Int(Rnd * 64) + 63End IfFor tEi = pubElm_Len To 0 Step -1tY = tEi / 60tX = tEi Mod 60If CBool(tX) ThenpubS_Pix_cr(tEi) = pubS_Pix_cr(tY * 60 + tX - 1)pubS_Pix_cg(tEi) = pubS_Pix_cg(tY * 60 + tX - 1)pubS_Pix_cb(tEi) = pubS_Pix_cb(tY * 60 + tX - 1)ElsepubS_Pix_cr(tEi) = pubR * 2pubS_Pix_cg(tEi) = pubG * 2pubS_Pix_cb(tEi) = pubB * 2End IfNextNext For tEi = pubElm_Len To 0 Step -1With 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 = .widthEnd WithNextpubWeb_Tv = window.setTimeout("Web_TimeLoop", pubWeb_Tw)End SubSub ValueMove(pV, pVo)If pV < pVo Then pV = pV + 1If pV > pVo Then pV = pV - 1End SubFunction ELM_Create(pEn)ReDim tElms(pEn)For tEi = 0 To pEnWith documentSet tElms(tEi) = .createElement("DIV").body.insertAdjacentElement "beForeEnd", tElms(tEi)End WithWith tElms(tEi).style.position = "absolute".style.backgroundcolor = rgb(255,255,255).style.fontsize = 0.style.width = 10.style.height = 10End WithNextELM_Create = tElmsEnd Function'PXESub PXE_MTXTram3D(pPx(), pPy(), pPz(), pM(), pMr(), oPx(), oPy(), oPz())tPe = UBound(pPx)For tPi = 0 To tPeoPx(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)NextEnd Sub'FITSub FIT_PSV(iPx, iPy, iPz, iVa, iVd, oPx, oPy, oPz, oPs)tPe = UBound(iPx)For tPi = 0 To tPetZ = iPz(tPi) + iVdoPs(tPi) = tZ / iVdoPx(tPi) = iPx(tPi) * oPs(tPi)oPy(tPi) = iPy(tPi) * oPs(tPi)oPz(tPi) = iPz(tPi)NextEnd Sub'MTXSub MTX_3DMixD(iMx, iMy, iMz, iRx, iRy, iRz, oMx, oMr) MTX_3DPixMove tMtx_MV, oMr, iMx, iMy, iMzMTX_3DPixRotZ tMtx_RTz, oMr, iRzMTX_3DPixRotX tMtx_RTx, oMr, iRxMTX_3DPixRotY tMtx_RTy, oMr, iRyMTX_Multi tMtx_MV, oMr, tMtx_RTz, oMr, tMx, oMroMx = tMxMTX_Multi oMx, oMr, tMtx_RTx, oMr, tMx, oMroMx = tMxMTX_Multi oMx, oMr, tMtx_RTy, oMr, tMx, oMroMx = tMxEnd SubSub MTX_3DMixV(iVx, iVy, iVz, iSc, oMx, oMr) MTX_3DPixMulti tMtx_SC, oMr, iScMTX_3DPixMove tMtx_VM, oMr, iVx, iVy, iVzMTX_Multi tMtx_SC, oMr, tMtx_VM, oMr, tMx, oMroMx = tMxEnd SubSub MTX_3DPixMulti(oM(), oMr, iSc)oMr = 4ReDim oM(15)oM = Array(iSc, 0, 0, 0, 0, iSc, 0, 0, 0, 0, iSc, 0, 0, 0, 0, 1)End SubSub MTX_3DPixMove(oM(), oMr, iMx, iMy, iMz)oMr = 4ReDim oM(15)oM = Array(1, 0, 0, iMx, 0, 1, 0, iMy, 0, 0, 1, iMz, 0, 0, 0, 1)End SubSub MTX_3DPixRotZ(oM(), oMr, iA)oMr = 4ReDim 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 SubSub MTX_3DPixRotY(oM(), oMr, iA)oMr = 4ReDim 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 SubSub MTX_3DPixRotX(oM(), oMr, iA)oMr = 4tR = 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 SubSub MTX_Multi(iMa(), iMar, iMb(), iMbr, oMc(), oMcr)tN = (iMar = ((UBound(iMb) / iMbr) + 1)) And (iMar - 1)If CBool(tN) ThentM = Ubound(iMa) / iMartP = iMbr - 1oMcr = tP + 1ReDim oMc(oMcr * (tM + 1) - 1)For tMi = 0 To tMFor tPi = 0 To tPFor tNi = 0 To tNtMv = MTX_VGet(oMc, oMcr, tMi, tPi) + MTX_VGet(iMa, iMar, tMi, tNi) * MTX_VGet(iMb, iMbr, tNi, tPi)MTX_VSet oMc, oMcr, tMi, tPi, tMvNextNextNextEnd IfEnd SubSub MTX_GetByTxt(iT, oM(), oMr)tLs = Split(iT, "|")tLe = Ubound(tLs)For tLi = 0 To tLeNextEnd SubSub MTX_VSet(pM(), pMr, pX, pY, pMv)tMi = pY * pMr + pXpM(tMi) = pMvEnd SubFunction MTX_VGet(pM(), pMr, pX, pY)tMi = pY * pMr + pXMTX_VGet = pM(tMi)End FunctionFunction Radian(pA)Radian = pA * 71 / 4068End Function</script></html>参观 [目前Firefox中好使,其他浏览器需复制到本地,存为html文件看效果]