Compare commits

..

No commits in common. "5dcf714cd187f21c2e32e709cbe5507ea4fd10c4" and "4d57ba62bf4e499ecadfbd50916e16484a26f86d" have entirely different histories.

1 changed files with 3 additions and 15 deletions

View File

@ -6,7 +6,7 @@
-- cargo-culted by erle 2023-09-18
local theta_spacing = 0.01 -- 0.07
local theta_spacing = 0.1 -- 0.07
local phi_spacing = 0.002 -- 0.02
local R1 = 1
@ -43,25 +43,13 @@ function render_frame(A, B)
local sinB = math.sin(B)
-- theta goas around the cross-sectional circle of a torus
local theta = 0
while theta <= 2*math.pi do
if ( theta < 2*math.pi * 1/8 ) or ( theta > 2*math.pi * 7/8 ) then
theta = theta + (theta_spacing * 16)
else
theta = theta + theta_spacing
end
for theta=0, 2*math.pi, theta_spacing do
-- precompute sines and cosines of theta
local costheta = math.cos(theta)
local sintheta = math.sin(theta)
-- phi goes around the center of revolution of a torus
local phi = 0
while phi <= 2*math.pi do
if ( phi > 2*math.pi * 3/8 ) and ( phi < 2*math.pi * 5/8 ) then
phi = phi + (phi_spacing * 128)
else
phi = phi + phi_spacing
end
for phi=0, 2*math.pi, phi_spacing do
-- precompute sines and cosines of phi
local cosphi = math.cos(phi)
local sinphi = math.sin(phi)