SCREEN 9, 0, 1, 0 CLS DIM points AS INTEGER, polygons AS INTEGER, i AS INTEGER DIM pointx(100), pointy(100), pointz(100) DIM pointx2(100), pointy2(100) DIM xo(100), yo(100), zo(100) DIM polygon1(100), polygon2(100), polygon3(100) DIM polygon4(100), col(100), xr(100), yr(100), zr(100) DIM vectorx1(100), vectorx2(100), vectory1(100), vectory2(100) DIM vectorz1(100), vectorz2(100), dotvectorx(100), dotvectory(100) DIM dotvectorz(100), dotvectory2(100), dotvectorx2(100) DIM framecount AS LONG, polygoncount AS LONG thetamov = .001 phimov = .001 RANDOMIZE TIMER PRINT "Welcome to WireFrame V1.1 (build 3, 21/3/1)" PRINT PRINT "(c)MMI Joseph Curtis, Superion Technologies INC." PRINT PRINT PRINT PRINT PRINT "Keybindings" PRINT "----------------------" PRINT "Move left,right: 4,6" PRINT "Move up, down: 8,2" PRINT "Move in, out: +,-" PRINT "Rotate on Y axis: a,z" PRINT "Rotate of Z axis: s,x" PRINT "Stop all rotation: 5" PRINT "Center object: c" PRINT "Quit: q" PRINT "Keybindings: k" PRINT "----------------------" PRINT PRINT "Press any key to continue" PCOPY 1, 0 SLEEP OPEN "e:\bc7\DATA.DAT" FOR INPUT AS #1 INPUT #1, points, polygons, rho FOR i = 1 TO points INPUT #1, pointx(i), pointy(i), pointz(i) xo(i) = pointx(i) yo(i) = pointy(i) zo(i) = pointz(i) NEXT i FOR i = 1 TO polygons INPUT #1, polygon1(i), polygon2(i), polygon3(i), col(i) NEXT i CLOSE #1 theta = 0 phi = 0 xcenter = 320 ycenter = 175 zcenter = 256 start = TIMER DO CLS FOR i = 1 TO points pointx(i) = pointx(i) + xmov pointy(i) = pointy(i) + ymov pointz(i) = pointz(i) + zmov theta = theta + thetamov phi = phi + phimov rho = rho + rhomov xr(i) = -pointx(i) * SIN(theta) + pointy(i) * COS(theta) yr(i) = -pointx(i) * COS(theta) * SIN(phi) - pointy(i) * SIN(theta) * SIN(phi) - pointz(i) * COS(phi) + rho zr(i) = -pointx(i) * COS(theta) * COS(phi) - pointy(i) * SIN(theta) * COS(phi) + pointz(i) * SIN(phi) pointx2(i) = 256 * (xr(i) / (zr(i) + zcenter)) + xcenter pointy2(i) = 256 * (yr(i) / (zr(i) + zcenter)) + ycenter PSET (pointx2(i), pointy2(i)) NEXT i FOR i = 1 TO polygons LINE (pointx2(polygon1(i)), pointy2(polygon1(i)))-(pointx2(polygon2(i)), pointy2(polygon2(i))), col(i) LINE (pointx2(polygon2(i)), pointy2(polygon2(i)))-(pointx2(polygon3(i)), pointy2(polygon3(i))), col(i) LINE (pointx2(polygon3(i)), pointy2(polygon3(i)))-(pointx2(polygon1(i)), pointy2(polygon1(i))), col(i) polygoncount = polygoncount + 1 NEXT i framecount = framecount + 1 finish = TIMER IF (finish - start) <> 0 THEN PRINT "FPS: "; framecount / (finish - start) PRINT "PPS: "; polygoncount / (finish - start) PRINT "Frames: "; framecount PRINT "Polygons: "; polygoncount PRINT "Time: "; finish - start END IF a$ = INKEY$ SELECT CASE a$ CASE "6" ymov = ymov + 1 CASE "4" ymov = ymov - 1 CASE "8" zmov = zmov + 1 CASE "2" zmov = zmov - 1 CASE "+" xmov = xmov + 1 CASE "-" xmov = xmov - 1 CASE "a", "A" phimov = phimov + .001 CASE "z", "Z" phimov = phimov - .001 CASE "s", "S" thetamov = thetamov + .001 CASE "x", "X" thetamov = thetamov - .001 CASE "q", "Q" END CASE "k", "K" PRINT "Welcome to WireFrame V1.1 (build 3, 21/3/1)" PRINT PRINT "(c)MMI Joseph Curtis, Superion Technologies INC." PRINT PRINT PRINT PRINT PRINT "Keybindings" PRINT "----------------------" PRINT "Move left,right: 4,6" PRINT "Move up, down: 8,2" PRINT "Move in, out: +,-" PRINT "Rotate on Y axis: a,z" PRINT "Rotate of Z axis: s,x" PRINT "Stop all rotation: 5" PRINT "Center object: c" PRINT "Quit: q" PRINT "Keybindings: k" PRINT "----------------------" PRINT PRINT "Press any key to continue" PCOPY 1, 0 SLEEP CASE "5" thetamov = 0 phimov = 0 CASE "c", "C" xmov = 0 ymov = 0 zmov = 0 FOR i = 1 TO points pointx(i) = xo(i) pointy(i) = yo(i) pointz(i) = zo(i) NEXT i END SELECT PCOPY 1, 0 LOOP