@bbcmicrobot @geoffl I had a sign flipped 🤦 also fixed the z-offset, shading looks much better now I think.
Conversation
Notices
-
Embed this notice
bazzargh@hachyderm.io's status on Saturday, 24-Feb-2024 22:12:14 JST bazzargh -
Embed this notice
bazzargh@hachyderm.io's status on Saturday, 24-Feb-2024 22:12:15 JST bazzargh @bbcmicrobot @geoffl Messing with the maths, which I probably got wrong-I see I left in an unnecessary if abs(K)<abs(X). At each value of x from -(R+r) to (R+r) and each value of K=(R+rcosv) I get the 4 points on the surface and plot them. Seems to have enough density to avoid bleed, but the shading looks wrong to me, I think I have incorrect Z-values in there
-
Embed this notice
bazzargh@hachyderm.io's status on Saturday, 24-Feb-2024 22:12:17 JST bazzargh @geoffl #bbcmicrobot 🚀 MODE0
R=100
r=22:G=R+r
FORW=0TO450STEP93
S=SINRAD(W+33)
C=COSRAD(W+33)
FORX%=0TOG:F=X%:IFF<R-r:F=R-r
FORI=0TO60:K=F+I*(G-F)/60
IFABS(K)<ABS(X%)GOTO160
Z%=S*SQR(r*r-(K-R)*(K-R))
Y%=C*SQR(K*K-X%*X%)
FORM%=-1TO1STEP2:FORN%=-1TO1STEP2:FORO%=-1TO1STEP2
A%=M%*X%+W*1.5:B%=N%*Y%+O%*Z%+256:J%=(7*(A% MOD4)+5*(B% MOD4))MOD16
IF(N%*Y%*S/C+O%*Z%*C/S)+300>35*J%:PLOT69,2*A%,2*B%
NEXT,,
NEXT,, -
Embed this notice
BBC Micro Bot :mastodon: (bbcmicrobot@mastodon.me.uk)'s status on Saturday, 24-Feb-2024 22:12:17 JST BBC Micro Bot :mastodon: I ran @bazzargh's program and got this.
Source: https://bbcmic.ro/?t=9qOzN #bbcbasic -
Embed this notice
groff (geoffl@mastodon.me.uk)'s status on Saturday, 24-Feb-2024 22:12:19 JST groff @bazzargh #bbcmicrobot 🚀
MO.0:DIMS(720),D(7,7):F.I=0TO720:S(I)=SINRADI:N.
FORI=0TO7:FORJ=0TO7
D(I,J)=(I DIV4*2+J DIV4*3)MOD4+(I DIV 2 MOD 2*2+J DIV2 MOD2*3)MOD4*4+(I MOD2*2+J MOD2*3)MOD4*16
N.,
W=48:R=14
F.A=0TO360S.64
T=((2+(A DIV64))*80)MOD360
F.U=0TO-(A>0)*180+179
F.V=0TO89
B=W+R*S(4*V)
X=(A+B*S(U))*2
Y=INT(B*S(U+90))
Z=R*S(4*V+90)
M=Y*S(T+90)+Z*S(T)
N=Y*S(T)-Z*S(T+90)+R*3
C=1/16:IFN>0:C=C+N/R*.2
G=((INTM*4)+512)MOD8
H=(ABSX*2)MOD8
IFC*16>D(G,H) PLOT69,2*INTX,512+4*INTM
N.,,In conversation permalink -
Embed this notice
groff (geoffl@mastodon.me.uk)'s status on Saturday, 24-Feb-2024 22:12:20 JST groff @bbcmicrobot pre-calculating the SIN table from 0 to 720 degrees saves 129,600 MOD360 commands being executed.
In conversation permalink
-
Embed this notice