Data update

This commit is contained in:
Ingy döt Net 2025-08-11 18:05:26 -07:00
parent 4d5544505c
commit 4924dd0264
3073 changed files with 55820 additions and 4408 deletions

View file

@ -0,0 +1,25 @@
func vdot a[] b[] .
for i to len a[] : r += a[i] * b[i]
return r
.
func[] norm v[] .
d = vdot v[] v[]
invl = 1 / sqrt d
for i to 3 : r[] &= v[i] * invl
return r[]
.
proc sphere r k amb dir[] .
for x = -r to r : for y = -r to r
z = r * r - x * x - y * y
if z >= 0
s = vdot dir[] norm [ x y sqrt z ]
if s < 0 : s = 0
lum = 100 * (pow s k + amb) / (1 + amb)
gcolor3 lum lum lum
grect 50 + x / 5, 50 + y / 5, 0.3 0.3
.
.
.
gbackground 000
gclear
sphere 200 1.5 0.2 norm [ -30 30 50 ]