REM Project: 3ddotline
REM Created: 9/25/2007 4:27:47 PM
REM
REM ***** Main Source File *****
REM
Dim dotx(8) as float
Dim doty(8) as float
Dim dotz(8) as float
dotx(0) = 0.0
doty(0) = 0.0
dotz(0) = 1.00
dotx(1) = 0.0
doty(1) = 10.0
dotz(1) = 1.00
dotx(2) = 10.0
doty(2) = 0.0
dotz(2) = 1.00
dotx(3) = 10.0
doty(3) = 10.0
dotz(3) = 1.00
dotx(4) = 0.0
doty(4) = 0.0
dotz(4) = 1.10
dotx(5) = 0.0
doty(5) = 10.0
dotz(5) = 1.10
dotx(6) = 10.0
doty(6) = 0.0
dotz(6) = 1.10
dotx(7) = 10.0
doty(7) = 10.0
dotz(7) = 1.10
Global scw as integer = 320
Global sch as integer = 240
Do
cls
Vertex(0,1)
Vertex(0,2)
Vertex(1,3)
Vertex(2,3)
Vertex(4,5)
Vertex(4,6)
Vertex(5,7)
Vertex(6,7)
Vertex(0,4)
Vertex(1,5)
Vertex(2,6)
Vertex(3,7)
If Upkey()
For v = 0 to 7
doty(v) = doty(v) - 0.1
Next v
Endif
If Leftkey()
For v = 0 to 7
dotx(v) = dotx(v) - 0.1
Next v
Endif
If Rightkey()
For v = 0 to 7
dotx(v) = dotx(v) + 0.1
Next v
Endif
If Downkey()
For v = 0 to 7
doty(v) = doty(v) + 0.1
Next v
Endif
If Shiftkey()
For v = 0 to 7
dotz(v) = dotz(v) + 0.01
Next v
Endif
If Controlkey()
For v = 0 to 7
dotz(v) = dotz(v) - 0.01
Next v
Endif
Loop
Function Vertex(pin1,pin2)
local xp1 as integer
local xp2 as integer
local yp1 as integer
local yp2 as integer
If dotz(pin1) > 0
xp1 = (( dotx(pin1) )*( dotz(pin1) )) + scw
yp1 = (( doty(pin1) )*( dotz(pin1) )) + sch
Endif
If dotz(pin1) <= 0
xp1 = scw
yp1 = sch
Endif
If dotz(pin2) > 0
xp2 = (( dotx(pin2) )*( dotz(pin2) )) + scw
yp2 = (( doty(pin2) )*( dotz(pin2) )) + sch
Endif
If dotz(pin2) <= 0
xp2 = scw
yp2 = sch
Endif
Line xp1,yp1,xp2,yp2
EndFunction
It works but... The box is infinitely long!
Controls are up,down,left,right,ctrl,shift
Your signature has been deleted by a moderator because this joke is getting old.