节日快到,发几个霓虹灯的脚本助助兴!
第一个:
第一个:
1
<script languate="VBScript" type="text/VBScript">
2
Dim pubS_Pix_x
3
Dim pubS_Pix_y
4
Dim pubS_Pix_z
5
Dim pubS_Pix_cr
6
Dim pubS_Pix_cg
7
Dim pubS_Pix_cb
8
Dim pubD_Mx
9
Dim pubD_My
10
Dim pubD_Mz
11
Dim pubD_Rx
12
Dim pubD_Ry
13
Dim pubD_Rz
14
Dim pubD_Mtx_Mx
15
Dim pubD_Mtx_Mr
16
Dim pubD_Pix_x
17
Dim pubD_Pix_y
18
Dim pubD_Pix_z
19
Dim pubF_Va
20
Dim pubF_Vd
21
Dim pubV_Vx
22
Dim pubV_Vy
23
Dim pubV_Vz
24
Dim pubV_Sc
25
Dim pubV_Mtx_Mx
26
Dim pubV_Mtx_Mr
27
Dim pubV_Pix_x
28
Dim pubV_Pix_y
29
Dim pubV_Pix_z
30
Dim pubElm
31
Dim pubElm_Len
32
Dim pubWeb_Tv
33
Dim pubWeb_Tw
34
Dim pubWeb_WW, pubWeb_WH
35
Dim pubR, pubG, pubB
36
Dim pubOR, pubOG, pubOB
37
'Web DHTML 事件函数
38
Sub window_onload()
39
MakeModule
40
41
With document.body
42
pubWeb_WW = .clientWidth
43
pubWeb_WH = .clientHeight
44
End With
45
pubD_Rz = 0
46
pubD_Rx = 0
47
pubD_Ry = 0
48
pubF_Va = 15
49
pubF_Vd = 20
50
51
pubV_Vx = pubWeb_WW \ 2
52
pubV_Vy = pubWeb_WH \ 3
53
pubV_Vz = 0
54
pubV_Sc = 10
55
pubWeb_Tw = 33
56
MTX_3DMixV pubV_Vx, pubV_Vy, pubV_Vz, pubV_Sc, pubV_Mtx_Mx, pubV_Mtx_Mr
57
58
Web_TimeLoop
59
60
End Sub
61
Sub MakeModule
62
pubElm_Len = 599
63
pubElm = ELM_Create(pubElm_Len)
64
ReDim pubS_Pix_x(pubElm_Len), pubS_Pix_y(pubElm_Len), pubS_Pix_z(pubElm_Len)
65
ReDim pubD_Pix_x(pubElm_Len), pubD_Pix_y(pubElm_Len), pubD_Pix_z(pubElm_Len)
66
ReDim pubV_Pix_x(pubElm_Len), pubV_Pix_y(pubElm_Len), pubV_Pix_z(pubElm_Len)
67
ReDim pubS_Pix_cr(pubElm_Len), pubS_Pix_cg(pubElm_Len), pubS_Pix_cb(pubElm_Len)
68
tH = 100
69
tR = 0
70
For tI = 1 To 1500 Step 15
71
tR = tI * 15 / 1500 + 5
72
tA = tA + (1000 / (tR * 2 * 3.14))
73
tZ = 30 - tI * 30 / 1500
74
tAr = Radian(tA)
75
For tRd = Int(tR) To Int(tR) - 5 Step -1
76
tX = Sin(tAr) * tRd
77
tY = Cos(tAr) * tRd
78
pubS_Pix_x(tAdd) = tX
79
pubS_Pix_y(tAdd) = tY
80
pubS_Pix_z(tAdd) = tZ
81
tAdd = tAdd + 1
82
Next
83
Next
84
'MsgBox tAdd
85
pubD_Mx = 0
86
pubD_My = 0
87
pubD_Mz = 0
88
End Sub
89
Sub Web_TimeLoop()
90
pubD_Rz = (pubD_Rz + 1) Mod 360
91
pubD_Rx = 45
92
pubD_Ry = 0
93
MTX_3DMixD pubD_Mx, pubD_My, pubD_Mz, pubD_Rx, pubD_Ry, pubD_Rz, pubD_Mtx_Mx, pubD_Mtx_Mr
94
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
95
FIT_PSV pubD_Pix_x, pubD_Pix_y, pubD_Pix_z, pubF_Va, pubF_Vd, pubD_Pix_x, pubD_Pix_y, pubD_Pix_z
96
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
97
98
For tI = 0 To 5
99
For tEi = pubElm_Len To 0 Step -1
100
If CBool(tEi) Then
101
pubS_Pix_cr(tEi) = pubS_Pix_cr(tEi-1)
102
pubS_Pix_cg(tEi) = pubS_Pix_cg(tEi-1)
103
pubS_Pix_cb(tEi) = pubS_Pix_cb(tEi-1)
104
Else
105
If pubR < pubOR Then pubR = pubR + 1
106
If pubR > pubOR Then pubR = pubR - 1
107
If pubG < pubOG Then pubG = pubG + 1
108
If pubG > pubOG Then pubG = pubG - 1
109
If pubB < pubOB Then pubB = pubB + 1
110
If pubB > pubOB Then pubB = pubB - 1
111
If pubR = pubOR And pubB = pubOB And pubG = pubOG Then
112
pubOR = Int(Rnd * 32) + 31
113
pubOG = Int(Rnd * 32) + 31
114
pubOB = Int(Rnd * 32) + 31
115
End If
116
pubS_Pix_cr(tEi) = pubR*4
117
pubS_Pix_cg(tEi) = pubG*4
118
pubS_Pix_cb(tEi) = pubB*4
119
End If
120
Next
121
Next
122
For tEi = pubElm_Len To 0 Step -1
123
With pubElm(tEi).style
124
.left = pubV_Pix_x(tEi)
125
.top = pubV_Pix_y(tEi)
126
tL = tEi Mod 6 + 1
127
.color = rgb(pubS_Pix_cr(tEi)\tL,pubS_Pix_cg(tEi)\tL,pubS_Pix_cb(tEi)\tL)
128
End With
129
Next
130
131
pubWeb_Tv = window.setTimeout("Web_TimeLoop", pubWeb_Tw)
132
End Sub
133
Function ELM_Create(pEn)
134
ReDim tElms(pEn)
135
For tEi = 0 To pEn
136
With document
137
Set tElms(tEi) = .createElement("SPAN")
138
.body.insertAdjacentElement "beForeEnd", tElms(tEi)
139
End With
140
With tElms(tEi)
141
.innerText = "*"
142
.style.position = "absolute"
143
.style.color = rgb(0,0,0)
144
End With
145
Next
146
ELM_Create = tElms
147
End Function
148
Sub PXE_MTXTram2D(pPx(), pPy(), pM(), pMr, oPx(), oPy())
149
tPe = UBound(pPx)
150
For tPi = 0 To tPe
151
oPx(tPi) = pPx(tPi) * pM(0) + pPy(tPi) * pM(1) + pM(2)
152
oPy(tPi) = pPx(tPi) * pM(3) + pPy(tPi) * pM(4) + pM(5)
153
Next
154
End Sub
155
Sub PXE_MTXTram3D(pPx(), pPy(), pPz(), pM(), pMr(), oPx(), oPy(), oPz())
156
tPe = UBound(pPx)
157
For tPi = 0 To tPe
158
oPx(tPi) = pPx(tPi) * pM(0) + pPy(tPi) * pM(1) + pPz(tPi) * pM(2) + pM(3)
159
oPy(tPi) = pPx(tPi) * pM(4) + pPy(tPi) * pM(5) + pPz(tPi) * pM(6) + pM(7)
160
oPz(tPi) = pPx(tPi) * pM(8) + pPy(tPi) * pM(9) + pPz(tPi) * pM(10) + pM(11)
161
Next
162
End Sub
163
Sub FIT_PSV(iPx, iPy, iPz, iVa, iVd, oPx, oPy, oPz)
164
tPe = UBound(iPx)
165
For tPi = 0 To tPe
166
tVr = Sin(Radian(iVa))
167
tZ = iPz(tPi) + iVd
168
oPx(tPi) = iPx(tPi) * tVr * tZ / (tVr * iVd)
169
oPy(tPi) = iPy(tPi) * tVr * tZ / (tVr * iVd)
170
oPz(tPi)

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170
