[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
3W
2X:2Z
DispGraph
prgmDOOMDLL

Lbl 0
getKeyK

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

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

If K=25
Then

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

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

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

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

End

If K=34
Then

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

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

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

If W=4 and [A](X-1,Z)=0
Then
X-1X
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(2X,2Y
Pt-Change(2X,2Y
Pt-Change(2X,2Y
Pt-Change(2X,2Y
sin(sin(sin(1
Pt-Change(0,0
Pt-Change(2X,2Y
Pt-Change(2X,2Y
Pt-Change(2X,2Y
Pt-Change(2X,2Y
For(A,1,8,2
Line(L(A),L(A+1),L(A)-3X,L(A+1)+3Y
For(B,1,10:End
Line(L(A),L(A+1),L(A)-3X,L(A+1)+3Y,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 getKey0:End
Output(X,Z," "
DispGraph
Goto 0

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

ClrDraw
RecallPic 4
10A
10B
10C
10D



If W=1
Then
ZF
XE

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/2A:B/2B:C/2C:D/2D

F-1F

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

ZF
XE

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/2A:B/2B:C/2C:D/2D

E-1E

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
ZF
XE

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 (FZ)(FZ+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/2A:B/2B:C/2C:D/2D
F+1F
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
ZF
XE

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/2A:B/2B:C/2C:D/2D

E+1E

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: