Init
Frame
pi=acos(-1);orxs=pi/70;orys=pi/60;orxs=pi/50;n=4000;dst=tan(120*(pi/180)/2);
Point (The big one)
orx=orx+orxs;ory=ory+orys;orz=orz+orzs;lz=0;lx=1;ly=0;
The only variables you need to know, are the (lx,ly,lz) ones, these define the light position, and the higher the n, the better the look, the slower it runs...
z1=sin(i*pi*n/8)/10;
y1=0*cos(i*pi*2)+(cos(i*pi*n/8)/10+.9)*sin(i*pi*2);
x1=(cos(i*pi*n/8)/10+.9)*cos(i*pi*2)-0*sin(i*pi*2);
z3=sin((i+1/n/8)*pi*n/8)/10;
y3=0*cos(i*pi*2)+(cos((i+1/n/8)*pi*n/8)/10+.9)*sin(i*pi*2);
x3=(cos((i+1/n/8)*pi*n/8)/10+.9)*cos(i*pi*2)-0*sin(i*pi*2);
z2=sin(i*pi*n/8)/10;
y2=0*cos((i+1/n*2)*pi*2)+(cos(i*pi*n/8)/10+.9)*sin((i+1/n*2)*pi*2);
x2=(cos(i*pi*n/8)/10+.9)*cos((i+1/n*2)*pi*2)-0*sin((i+1/n*2)*pi*2);
tx=x1*cos(orz)-y1*sin(orz);ty=y1*cos(orz)+x1*sin(orz);x=tx*cos(ory)-z1*sin(ory);
tz=z1*cos(ory)+tx*sin(ory);z=tz*cos(orx)-ty*sin(orx);y=ty*cos(orx)+tz*sin(orx);
tx=x2*cos(orz)-y2*sin(orz);ty=y2*cos(orz)+x2*sin(orz);x2=tx*cos(ory)-z2*sin(ory);
tz=z2*cos(ory)+tx*sin(ory);z2=tz*cos(orx)-ty*sin(orx);y2=ty*cos(orx)+tz*sin(orx);
tx=x3*cos(orz)-y3*sin(orz);ty=y3*cos(orz)+x3*sin(orz);x3=tx*cos(ory)-z3*sin(ory);
tz=z3*cos(ory)+tx*sin(ory);z3=tz*cos(orx)-ty*sin(orx);y3=ty*cos(orx)+tz*sin(orx);
x1=x;y1=y;z1=z;
x=x/(z+dst);y=y/(z+dst);
x4=x1-x2;x5=x1-x3;
y4=y1-y2;y5=y1-y3;
z4=z1-z2;z5=z1-z3;
nx=y4*z5-z4*y5;ny=z4*x5-x4*z5;nz=x4*y5-y4*x5;
dd=sqrt(nx*nx+ny*ny+nz*nz);nx=nx/dd;ny=ny/dd;nz=nz/dd;
ldx=x1-lx;ldy=y1-ly;ldz=z1-lz;
dd=sqrt(ldx*ldx+ldy*ldy+ldz*ldz);ldx=ldx/dd;ldy=ldy/dd;ldz=ldz/dd;
li=(nx*ldx+ny*ldy+nz*ldz);li=if(above(li,0),li,0);
br=if(above(z+dst,.5),1-((z)/(3-.5)),0);
red=br*li;
green=br*li;
blue=br*li;
And in case you were wondering, what the superscope does is calculate 3 points of a torus at once, and rotates them in 3D, then calculate the normals of the 3 points (making a face) by calculating the cross product, then takes a normalized value, and subtracts the point's position by the light value, then normalizes that, then uses the dot product of both normalized vectors to calculate the light intensity.
And if you have found a way of making it better, please let me know 🙂 (Although not many people may even know what a normal is...)

