2 ' made by Svjatoslav Agejenko
\r
4 ' H-Page: svjatoslav.eu
\r
5 ' E-Mail: svjatoslav@svjatoslav.eu
\r
7 DECLARE SUB chlin (x1!, y1!, z1!, q1!, x2!, y2!, z2!, q2!)
\r
8 DECLARE SUB rot (x1!, y1!, z1!, q1!, x4!, y4!, z4!, q4!)
\r
9 DECLARE SUB setpal ()
\r
10 DECLARE SUB getp (x1!, y1!, z1!, q1!, x2!, y2!, z2!, q2!, n!, rx!, ry!, rz!, rq!)
\r
11 DECLARE SUB qpyra (x1!, y1!, z1!, q1!, x2!, y2!, z2!, q2!, x3!, y3!, z3!, q3!, x4!, y4!, z4!, q4!, x5!, y5!, z5!, q5!)
\r
12 DECLARE FUNCTION vahe! (x1!, y1!, z1!, q1!, x2!, y2!, z2!, q2!)
\r
14 DIM SHARED an1, an2, an3, an4, an5, an6
\r
15 DIM SHARED myx, myy, myz, myq
\r
17 DIM SHARED s1, s2, s3, s4, s5, s6
\r
18 DIM SHARED c1, c2, c3, c4, c5, c6
\r
20 DIM SHARED px(1 TO 10)
\r
21 DIM SHARED py(1 TO 10)
\r
25 PRINT " 4D Engine, 2003.08"
\r
26 PRINT " Svjatoslav Agejenko: n0@hot.ee"
\r
42 PRINT " ESC - to quit program"
\r
44 PRINT "press any key to continue..."
\r
66 s1 = SIN(an1): c1 = COS(an1)
\r
67 s2 = SIN(an2): c2 = COS(an2)
\r
68 s3 = SIN(an3): c3 = COS(an3)
\r
69 s4 = SIN(an4): c4 = COS(an4)
\r
70 s5 = SIN(an5): c5 = COS(an5)
\r
71 s6 = SIN(an6): c6 = COS(an6)
\r
73 FOR frm = 1 TO 15 STEP 3
\r
74 qpyra -10, -10, -10, 0, 10, -10, -10, 0, 0, -10, 10, 0, 0, 10, 0, 0, 0, 0, 0, 10
\r
127 SUB chlin (ox1, oy1, oz1, oq1, ox2, oy2, oz2, oq2)
\r
128 x1 = ox1: y1 = oy1: z1 = oz1: q1 = oq1
\r
129 x2 = ox2: y2 = oy2: z2 = oz2: q2 = oq2
\r
131 IF (q1 > myq) AND (q2 < myq) THEN
\r
138 IF (q1 < myq) AND (q2 > myq) THEN
\r
143 rx = (x2 - x1) * jt + x1
\r
144 ry = (y2 - y1) * jt + y1
\r
145 rz = (z2 - z1) * jt + z1 + 50
\r
146 px(pm) = rx / rz * 700 + 320
\r
147 py(pm) = ry / rz * 700 + 240
\r
151 SUB getp (x1, y1, z1, q1, x2, y2, z2, q2, n, rx, ry, rz, rq)
\r
163 SUB qpyra (ox1, oy1, oz1, oq1, ox2, oy2, oz2, oq2, ox3, oy3, oz3, oq3, ox4, oy4, oz4, oq4, ox5, oy5, oz5, oq5)
\r
168 oq1 = oq1 - myq - frm
\r
173 oq2 = oq2 - myq - frm
\r
178 oq3 = oq3 - myq - frm
\r
183 oq4 = oq4 - myq - frm
\r
188 oq5 = oq5 - myq - frm
\r
190 rot ox1, oy1, oz1, oq1, x1, y1, z1, q1
\r
191 rot ox2, oy2, oz2, oq2, x2, y2, z2, q2
\r
192 rot ox3, oy3, oz3, oq3, x3, y3, z3, q3
\r
193 rot ox4, oy4, oz4, oq4, x4, y4, z4, q4
\r
194 rot ox5, oy5, oz5, oq5, x5, y5, z5, q5
\r
198 chlin x1, y1, z1, q1, x2, y2, z2, q2
\r
199 chlin x1, y1, z1, q1, x3, y3, z3, q3
\r
200 chlin x1, y1, z1, q1, x4, y4, z4, q4
\r
201 chlin x1, y1, z1, q1, x5, y5, z5, q5
\r
203 chlin x2, y2, z2, q2, x3, y3, z3, q3
\r
204 chlin x2, y2, z2, q2, x4, y4, z4, q4
\r
205 chlin x2, y2, z2, q2, x5, y5, z5, q5
\r
207 chlin x3, y3, z3, q3, x4, y4, z4, q4
\r
208 chlin x3, y3, z3, q3, x5, y5, z5, q5
\r
210 chlin x4, y4, z4, q4, x5, y5, z5, q5
\r
213 FOR b = a + 1 TO pm
\r
214 LINE (px(a), py(a))-(px(b), py(b)), 15 - frm
\r
221 SUB rot (x1, y1, z1, q1, x4, y4, z4, q4)
\r
224 q2 = q1 * s4 - x1 * c4
\r
225 x2 = q1 * c4 + x1 * s4
\r
228 q3 = q2 * s5 - y1 * c5
\r
229 y2 = q2 * c5 + y1 * s5
\r
232 q4 = q3 * s6 - z1 * c6
\r
233 z2 = q3 * c6 + z1 * s6
\r
236 x3 = x2 * s1 - z2 * c1
\r
237 z3 = x2 * c1 + z2 * s1
\r
240 y3 = y2 * s2 - z3 * c2
\r
241 z4 = y2 * c2 + z3 * s2
\r
244 y4 = y3 * s3 - x3 * c3
\r
245 x4 = y3 * c3 + x3 * s3
\r
257 LINE (a, 0)-(a, 400), a
\r
262 FUNCTION vahe (x1, y1, z1, q1, x2, y2, z2, q2)
\r
263 vahe = SQR((x1 - x2) ^ 2 + (y1 - y2) ^ 2 + (z1 - z2) ^ 2 + (q1 - q2) ^ 2)
\r