ozxy.xyz created November 1, 2021





Examples
Cube
// This is a spinning cube!
a=time
rot=[cos a,0,sin a,0;0,1,0,0;-sin a,0,cos a,0;0,0,0,1]
v=[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]
drawpoint [rot*v]
Double Diamonds
v=[0,1,0,1; 1,0,1,1; -1,0,1,1; -1,0,-1,1; 1,0,-1,1; 1,0,1,1]'
j=[0,0,0,0,0,0; 1,-1,0,0,0,0; 1,0,-1,0,0,0; 1,0,0,-1,0,0; 1,0,0,0,-1,0]

a=time
a=a-a%pi + max[a%pi-pi*0.5,0]*2
rz=[cos a,-sin a,0,0;sin a,cos a,0,0;0,0,1,0;0,0,0,1]
h=cos a

a=time+pi*0.5
a=a-a%pi + max[a%pi,pi*0.5]*2
rx=[1,0,0,0; 0,cos a,-sin a,0; 0,sin a,cos a,0; 0,0,0,1]
h=h*cos a

t=10*[1,0,0,1; 0,h,0,0; 0,0,1,1; 0,0,0,1]
r=rz*rx

d=r*t*v
setdrawcolor [h,0,0]
drawpoly d
setdrawcolor [1,1,1]
draw [d*j',d]

d=-d
setdrawcolor[0,0,0]
setdrawcolor [-h,0,0]
drawpoly d
Operators by precedence
OperatorName
Functions
Function Arguments Name