hi
im doing a 3d engine in Delphi (only with the Api SetPixel)...i mean im doing EVERYTHING..... and i draw it pixel per pixel!
and im doing some test..in DB...to understand how i should do it.. and here the begening of it (DB V1.13):
sync on
sync rate 0
NbPoint=8
dim XScreen(NbPoint)
dim YScreen(NbPoint)
dim cube2#(NbPoint,3)
dim cube#(NbPoint,3)
cube#(1,1)=0-10
cube#(1,2)=0-10
cube#(1,3)=10
cube#(2,1)=10
cube#(2,2)=0-10
cube#(2,3)=10
cube#(3,1)=10
cube#(3,2)=0-10
cube#(3,3)=0-10
cube#(4,1)=0-10
cube#(4,2)=0-10
cube#(4,3)=0-10
cube#(5,1)=0-10
cube#(5,2)=10
cube#(5,3)=10
cube#(6,1)=10
cube#(6,2)=10
cube#(6,3)=10
cube#(7,1)=10
cube#(7,2)=10
cube#(7,3)=0-10
cube#(8,1)=0-10
cube#(8,2)=10
cube#(8,3)=0-10
vw#=640
vh#=480
r#=1
rem XScreen=((x/z)*Vw*R)+VxMin+(Vw/2)
rem YScreen=((y/z)*Vw*(0-R))+VyMin+(Vh/2)
for i=1 to NbPoint
if cube2#(i,3)=0 then cube2#(i,3)=0.0000000000001
XScreen(i)=((cube2#(i,1)/cube2#(i,3))*Vw#*R#)+(Vw#/2.0)
YScreen(i)=((cube2#(i,2)/cube2#(i,3))*Vw#*(0-R#))+(Vh#/2.0)
next i
ink rgb(255,0,0),0
a#=0
do
cls
a#=wrapvalue(a#+1)
for i=1 to NbPoint
cube2#(i,1)=(cube#(i,1)*cos(a#))+(cube#(i,3)*sin(a#))
cube2#(i,2)=cube#(i,2)
cube2#(i,3)=(cube#(i,1)*(0-sin(a#)))+(cube#(i,3)*cos(a#))
next i
for i=1 to NbPoint
cube2#(i,3)=cube2#(i,3)+100
cube2#(i,2)=cube2#(i,2)-20
next i
for i=1 to NbPoint
if cube2#(i,3)=0 then cube2#(i,3)=0.0000000000001
XScreen(i)=((cube2#(i,1)/cube2#(i,3))*Vw#*R#)+(Vw#/2.0)
YScreen(i)=((cube2#(i,2)/cube2#(i,3))*Vw#*(0-R#))+(Vh#/2.0)
next i
for i=1 to NbPoint
dot XScreen(i),YScreen(i)
next i
sync
loop
feel free to say that im a genius.....cause i am one of them......