Hi, I made a program which draws a 3d cube and then you can move around in space to see it from different angles. It uses camera perspective, and uses matrices to track points, rotations, and translations. If anyone wants to, feel free to try to optimize it for speed. Tested on my original TI-83 (not plus).

prgmA3D

```
Input "ROTATION ANGLE:",theta
prgmthetaSSETUP
prgmthetaPOINTS
Repeat K=16
ClrDraw
"DRAW SCREEN"
[C]->[D]
dim([A])
Ans(2)
For(A,1,Ans-1)
augment([D],[C]->[D]
End
[J]*([A]-[D])->[B]
dim([B])
Ans(2)
{1,4}->L1
prgmthetaDRWPT
{1,2}->L1
prgmthetaDRWPT
{2,3}->L1
prgmthetaDRWPT
{3,4}->L1
prgmthetaDRWPT
{1,5}->L1
prgmthetaDRWPT
{2,6}->L1
prgmthetaDRWPT
{4,8}->L1
prgmthetaDRWPT
{3,7}->L1
prgmthetaDRWPT
{5,6}->L1
prgmthetaDRWPT
{6,7}->L1
prgmthetaDRWPT
{7,8}->L1
prgmthetaDRWPT
{8,5}->L1
prgmthetaDRWPT
Repeat K
getKey->K
End
If K=21
.5+[C](3,1)->[C](3,1)
If K=31
~.5+[C](3,1)->[C](3,1)
If K=82
.5+[C](1,1)->[C](1,1)
If K=84
~.5+[C](1,1)->[C](1,1)
If K=73
~.5+[C](2,1)->[C](2,1)
If K=93
.5+[C](2,1)->[C](2,1)
If K=26
[J]*[[1,0,0][0,cos(theta),~sin(theta)][0,sin(theta),cos(theta)]]->[J]
If K=24
[J]*[[1,0,0][0,cos(~theta),~sin(~theta)][0,sin(~theta),cos(~theta)]]->[J]
If K=25
[J]*[[cos(theta),0,~sin(theta)][0,1,0][sin(theta),0,cos(theta)]]->[J]
If K=34
[J]*[[cos(~theta),0,~sin(~theta)][0,1,0][sin(~theta),0,cos(~theta)]]->[J]
If K=22
[J]*[[cos(theta),~sin(theta),0][sin(theta),cos(theta),0][0,0,1]]->[J]
If K=23
[J]*[[cos(~theta),~sin(~theta),0][sin(~theta),cos(~theta),0][0,0,1]]->[J]
End
```

**Subprograms**

prgmthetaDRWPT

`Line(([B](1,L1(1)))S/([B](3,L1(1))),([B](2,L1(1)))S/([B](3,L1(1))),([B](1,L1(2)))S/([B](3,L1(2))),([B](2,L1(2)))S/([B](3,L1(2)))`

prgmthetaPOINTS

```
"POINTS
[[1,~1,~1,1,1,~1,~1,1,0][~1,~1,1,1,~1,~1,1,1,0][4,4,4,4,6,6,6,6,0]]->[A]
"CAM ROTATION
[[1,0,0][0,1,0][0,0,1]]->[J]
"CAM TRANS
[[0][0][0]]->[C]
"SCREEN DIST
3->S
```

prgmthetaSSETUP

```
ClrDraw
CoordOff
RectGC
GridOff
AxesOff
LabelOff
ExprOff
ZSquare
```

For the input rotation angle, use a small angle such as 11.25. Also make sure you are in degree mode.

You can put the program into Chemetech's sourcecoder 3 and download it to try it out.

Info:

the camera starts out pointing straight up along the z axis, at the cube which floats above it.

moves:

2nd +z

alpha -z

8 +y

2 -y

4 -x

6 +x

mode - rot z

del +rot z

up +rot y

down -rot y

left -rot x

right +rot x