[TIB] Re: 3-D graphics


[Prev][Next][Index][Thread]

[TIB] Re: 3-D graphics




here is the source of my current engine.
YOu will probably get an error because i cant send you the PICTURES (PIC1
PICT4) thru here.
some characters are erroneous because of some ti83 characters like
store,X,Lists,etc)
~but the code it self is here.


---if you want to try the code,,, remove all PICTURE recalling. But left the
RecallPic 0 instruction alone. thats realy needed
and please dont use this code or parts/modifications of it without giving me
some credit.
thankx----


prgmDOOMX        ---------- the main program

FnOff :PlotsOff :""üStr0:ZStandard:Zoom In:Zoom In:Zoom In
ClrHome
ClrDraw
3üW
2üX:2üZ
DispGraph
prgmDOOMDLL

Lbl 0
getKeyüK

If K=24
Then
W-1üW
If W=0
4üW
prgmDOOMDLL
End

If K=26
Then
W+1üW
If W=5
1üW
prgmDOOMDLL
End

If K=25
Then

If W=1 and [A](X,Z-1)=0
Then
Z-1üZ
prgmDOOMDLL
End

If W=2 and [A](X-1,Z)=0
Then
X-1üX
prgmDOOMDLL
End

If W=3 and [A](X,Z+1)=0
Then
Z+1üZ
prgmDOOMDLL
End

If W=4 and [A](X+1,Z)=0
Then
X+1üX
prgmDOOMDLL
End

End

If K=34
Then

If W=1 and [A](X,Z+1)=0
Then
Z+1üZ
prgmDOOMDLL
End

If W=2 and [A](X+1,Z)=0
Then
X+1üX
prgmDOOMDLL
End

If W=3 and [A](X,Z-1)=0
Then
Z-1üZ
prgmDOOMDLL
End

If W=4 and [A](X-1,Z)=0
Then
X-1üX
prgmDOOMDLL
End

End

If K=45
Then
ClrHome:ClrDraw:Output(8,1,""):Stop
End
If K=21
Then
StorePic 0
{2.831954295,ú3.546893668,1.970055162,ú2.053464755,.985027581,ú4.10692951,.6
15642238,ú5.787037037}üL�
Pt-Change(0,0
Pt-Change(ú2¾X,2¾Y
Pt-Change(ú2¾X,ú2¾Y
Pt-Change(2¾X,ú2¾Y
Pt-Change(2¾X,2¾Y
sin(sin(sin(1
Pt-Change(0,0
Pt-Change(ú2¾X,2¾Y
Pt-Change(ú2¾X,ú2¾Y
Pt-Change(2¾X,ú2¾Y
Pt-Change(2¾X,2¾Y
For(A,1,8,2
Line(L�(A),L�(A+1),L�(A)-3¾X,L�(A+1)+3¾Y
For(B,1,10:End
Line(L�(A),L�(A+1),L�(A)-3¾X,L�(A+1)+3¾Y,0
End
RecallPic 0
End
If K=22
Then
Goto M:End
Goto 0

Lbl M
If length(Str0)ø0:Goto MS
ClrHome
For(A,1,8
For(B,1,8
If [A](A,B)=1
Output(A,B,"O
End
End
Lbl MS
If W=1
"<"üStr0
If W=2
"^"üStr0
If W=3
">"üStr0
If W=4
"v"üStr0
Output(X,Z,Str0
Repeat getKeyø0:End
Output(X,Z," "
DispGraph
Goto 0

prgmDOOMDLL   ------------ The drawing engine itself. and some routines.

ClrDraw
RecallPic 4
ú10üA
10üB
ú10üC
ú10üD



If W=1
Then
ZüF
XüE

While [A](E,F)=0

If [A](E+1,F)=0
Then
Line(A/2,B/2,A,B/2
Line(C/2,D/2,C,D/2
Line(A,B,C,D
End

If [A](E+1,F)=1
Then
Line(A,B,C,D
Line(A,B,A/2,B/2
Line(C,D,C/2,D/2
End

If [A](E-1,F)=0
Then
Line(úA/2,B/2,úA,B/2
Line(úC/2,D/2,úC,D/2
Line(úA,B,úC,D
End

If [A](E-1,F)=1
Then
Line(úA,B,úC,D
Line(úA,B,úA/2,B/2
Line(úC,D,úC/2,D/2
End

A/2üA:B/2üB:C/2üC:D/2üD

F-1üF

End
Line(A,B,úA,B
Line(C,D,úC,D
Line(A,B,C,D
Line(úA,B,úC,D
End


If W=2
Then

ZüF
XüE

While [A](E,F)=0

If [A](E,F-1)=0
Then
Line(A/2,B/2,A,B/2
Line(C/2,D/2,C,D/2
Line(A,B,C,D
End

If [A](E,F-1)=1
Then
Line(A,B,C,D
Line(A,B,A/2,B/2
Line(C,D,C/2,D/2
End

If [A](E,F+1)=0
Then
Line(úA/2,B/2,úA,B/2
Line(úC/2,D/2,úC,D/2
Line(úA,B,úC,D
End

If [A](E,F+1)=1
Then
Line(úA,B,úC,D
Line(úA,B,úA/2,B/2
Line(úC,D,úC/2,D/2
End

A/2üA:B/2üB:C/2üC:D/2üD

E-1üE

End
Line(A,B,úA,B
Line(C,D,úC,D
Line(A,B,C,D
Line(úA,B,úC,D
End



If W=3
Then
ZüF
XüE

While [A](E,F)=0
If [A](E,F+1)=2 and (F=Z or F=Z+1)
Then
RecallPic 5
End
If [A](E,F+1)=2 and (FøZ)(FøZ+1)
Then
prgmA
End
If [A](E-1,F)=0
Then
Line(A/2,B/2,A,B/2
Line(C/2,D/2,C,D/2
Line(A,B,C,D
End
If [A](E-1,F)=1
Then
Line(A,B,C,D
Line(A,B,A/2,B/2
Line(C,D,C/2,D/2
End

If [A](E+1,F)=0
Then
Line(úA/2,B/2,úA,B/2
Line(úC/2,D/2,úC,D/2
Line(úA,B,úC,D
End
If [A](E+1,F)=1
Then
Line(úA,B,úC,D
Line(úA,B,úA/2,B/2
Line(úC,D,úC/2,D/2
End
A/2üA:B/2üB:C/2üC:D/2üD
F+1üF
End
Line(A,B,úA,B
Line(C,D,úC,D
Line(A,B,C,D
Line(úA,B,úC,D
End


If W=4
Then
ZüF
XüE

While [A](E,F)=0

If [A](E,F+1)=0
Then
Line(A/2,B/2,A,B/2
Line(C/2,D/2,C,D/2
Line(A,B,C,D
End

If [A](E,F+1)=1
Then
Line(A,B,C,D
Line(A,B,A/2,B/2
Line(C,D,C/2,D/2
End

If [A](E,F-1)=0
Then
Line(úA/2,B/2,úA,B/2
Line(úC/2,D/2,úC,D/2
Line(úA,B,úC,D
End

If [A](E,F-1)=1
Then
Line(úA,B,úC,D
Line(úA,B,úA/2,B/2
Line(úC,D,úC/2,D/2
End

A/2üA:B/2üB:C/2üC:D/2üD

E+1üE

End
Line(A,B,úA,B
Line(C,D,úC,D
Line(A,B,C,D
Line(úA,B,úC,D
End

RecallPic 4





------------------------------
end ------------------------------------------------------

BTW.... only the community can say if its fast enought.



RE:

Cool. Can you send me the source in .txt format? (I don't have access to a
GraphLink or the software, cause my sysadmin won't allow it.) BTW, how fast
is your engine?







References: