3D+ Rendering (Part 2?)
So, I recently picked up my CE after leaving it dormant for some time (programming wise) and I was looking through my programs and found my 3D rendering program. I played around with it, and after some tweaks, I've made it better, I think. Any thoughts?
ClrHome
{1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1→L₁
16.5→Xmax
-Ans→Xmin
10.25→Ymax
-Ans→Ymin
ClrDraw
GridOff
AxesOff
PlotsOff
FnOff
0→θ
Repeat getKey=45
startTmr→W
cos(θ→P
sin(θ
[[P²+Ans³,-PAns,PAns²-PAns][PAns-PAns²,P²,-P²-Ans²][PAns,Ans,P²→[C]
For(A,1,8
3A
[C][[L₁(Ans-2)][L₁(Ans-1)][L₁(Ans→[B]
20/(4-Ans(3,1→C
Ans[B](2,1→L₆(A
C[B](1,1→L₅(A
End
ClrDraw
For(A,1,4
1+remainder(A,4→U
Line(L₅(A),L₆(A),L₅(Ans),L₆(Ans),BLACK,1
A+4→V
U+4
Line(L₅(V),L₆(V),L₅(Ans),L₆(Ans),BLACK,1
Line(L₅(A),L₆(A),L₅(V),L₆(V),BLACK,1
End
θ+π/16→θ
End
ClrDraw
ClrHome
There's also another thing… a 4D HyperCube simulation, just… if anyone's interested…
ClrHome
{1,1,1,1,-1,1,1,1,-1,-1,1,1,1,-1,1,1,1,1,-1,1,-1,1,-1,1,-1,-1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,-1,-1,1,-1,1,-1,1,-1,1,1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1→L₁
-π/3→θ
cos(Ans→D
sin(θ→E
16.5→Xmax
-Ans→Xmin
10.25→Ymax
-Ans→Ymin
ClrDraw
GridOff
AxesOff
PlotsOff
FnOff
0→θ
Repeat getKey=45
startTmr→W
cos(θ→P
sin(θ
[[P,-Ans,0,0][DAns,DP,-EP,EAns][EAns,EP,DP,-DAns][0,0,Ans,P→[C]
For(A,1,16
4A
[C][[L₁(Ans-3)][L₁(Ans-2)][L₁(Ans-1)][L₁(Ans→[B]
60/(4-Ans(4,1))/(4-Ans(3,1→C
Ans[B](2,1→L₆(A
C[B](1,1→L₅(A
End
ClrDraw
For(B,0,8,8
For(A,1,4
A+B→V
Ans+4
Line(L₅(V),L₆(V),L₅(Ans),L₆(Ans),BLACK,1
B+1+remainder(A,4→U
V+4→V
U+4
Line(L₅(V),L₆(V),L₅(Ans),L₆(Ans),BLACK,1
End
End
For(A,1,8
A+8
Line(L₅(A),L₆(A),L₅(Ans),L₆(Ans),BLACK,1
End
θ+π/16→θ
End
ClrDraw
ClrHome