Escalator #2 (Sample Programs)

by lrcvs, Saturday, April 13, 2013, 15:29 (1562 days ago)
edited by lrcvs, Saturday, April 20, 2013, 11:03

Escalator #2

by lrcvs, Saturday, April 20, 2013, 11:02 (1555 days ago) @ lrcvs
edited by lrcvs, Tuesday, May 28, 2013, 19:44

Program:

I had to remove decorations, because with Basic - 256, is very slow.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

graphsize 640,480
pas = 1:col = 12:r = 65:con = 0:z = 10
dim pun (1452*z,2 )
for w = 1 to z:gosub trayectoria2:next w
for k = 1 to 1452*z
clg
fastgraphics
color white
for m= 1 to 1452 : plot pun [m,0 ],pun [m,1 ] :next m
color black
for j= 1 + k to 1452 + k step 31:gosub escalon:next j
refresh
next k
end

trayectoria2:
for n = 270 to 90 step - 1:gosub puntos:px = x + 80:py = y + 80:gosub almacenar:next n
x1 = 170:y1 = 145:x2 = 80:y2 = 145 : gosub linea_puntos2
for n = 270 to 315:gosub puntos:px = x + 170:py = y + 210:gosub almacenar:next n
x1 = 216:y1 = 164:x2 = 414:y2 = 348 : gosub linea_puntos2
for n = 135 to 90 step -1:gosub puntos:px = x + 458:py = y + 300:gosub almacenar:next n
x1 = 548:y1 = 365:x2 = 458:y2 = 365 : gosub linea_puntos2
for n = 450 to 270 step -1:gosub puntos:px = x + 548:py = y + 300:gosub almacenar:next n
x1 = 458:y1 = 235:x2 = 548:y2 = 235: gosub linea_puntos2
for n = 90 to 135:gosub puntos:px = x + 458:py = y + 170:gosub almacenar:next n
x1 = 414:y1 = 218:x2 = 216:y2 = 33: gosub linea_puntos2
for n = 315 to 270 step -1:gosub puntos:px = x + 170:py = y + 80:gosub almacenar:next n
x1 = 80:y1 = 15:x2 = 170:y2 = 15 : gosub linea_puntos2
return

linea_puntos2:
dx = abs (x1 - x2) :dy = abs (y1 - y2) :hip = sqr (abs ( (dx^2 )+ (dy^2 ))):ang = atan (dy / dx )
for n = 0 to hip step pas
y = sin (ang ) * n:x = cos (ang ) * n
if x1 < x2 and y1 < y2 then px = x + x1 :py = y + y1
if x1 < x2 and y1 > y2 then px = x + x1 :py = y1 - y
if x1 > x2 and y1 < y2 then px = x + x2 :py = y2 - y
if x1 > x2 and y1 > y2 then px = x1 - x :py = y1 - y
if x1 = x2 and y1 < y2 then px = x + x2 :py = y2 - y
if x1 = x2 and y1 > y2 then px = x + x2 :py = y2 + y
if x1 < x2 and y1 = y2 then px = x2 - x :py = y2 + y
if x1 > x2 and y1 = y2 then px = x2 + x :py = y2 + y
if x1 = x2 and y1 = y2 then px = x1 :py = y1
gosub almacenar
next n
return

puntos:
g = (n*2*pi )/360:x = cos (g ) * r:y = sin (g ) * r
return

almacenar:
con = con + 1:pun [con-1,0 ] = px:pun [con-1,1 ] = py
return

escalon:
line pun [j,0 ]+30, pun [j,1 ],pun [j,0 ],pun [j,1 ]
line pun [j,0 ], pun [j,1 ],pun [j,0 ]+23,pun [j,1 ]+21
line pun [j,0 ]+30, pun [j,1 ],pun [j,0 ]+23,pun [j,1 ]+21
return

Escalator #2

by lrcvs, Wednesday, May 15, 2013, 18:44 (1530 days ago) @ lrcvs

Escalator #2, False perpestive "3D"

http://www.youtube.com/watch?v=xEl5FW9JFwY

RSS Feed of thread
powered by my little forum