mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-24 08:59:32 +01:00
Partially slice 3D rendered donut along its polodial direction
This commit is contained in:
parent
0c6d9a4d85
commit
5dcf714cd1
1 changed files with 7 additions and 1 deletions
|
@ -55,7 +55,13 @@ function render_frame(A, B)
|
||||||
local sintheta = math.sin(theta)
|
local sintheta = math.sin(theta)
|
||||||
|
|
||||||
-- phi goes around the center of revolution of a torus
|
-- phi goes around the center of revolution of a torus
|
||||||
for phi=0, 2*math.pi, phi_spacing do
|
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
|
||||||
-- precompute sines and cosines of phi
|
-- precompute sines and cosines of phi
|
||||||
local cosphi = math.cos(phi)
|
local cosphi = math.cos(phi)
|
||||||
local sinphi = math.sin(phi)
|
local sinphi = math.sin(phi)
|
||||||
|
|
Loading…
Reference in a new issue