POV-Ray : Newsgroups : povray.binaries.images : Helical SDF for Isosurfaces : Re: Helical SDF for Isosurfaces Server Time
4 Jan 2025 18:23:56 EST (-0500)
  Re: Helical SDF for Isosurfaces  
From: Bald Eagle
Date: 23 Dec 2024 10:00:00
Message: <web.67697a7d4a98c6d6471fd7cd25979125@news.povray.org>
> I think the most useful thing to do at this point would be to ditch the
> isosurface renderings and simply start graphing the equations to see where
> things get out of joint.

So, here's a Desmos graph of what I was striving to implement in SDL.

We're going around in a circle, but we want to graph things in rectangular
coordinates, so we pretend x is theta, and take the cos and sin of "theta" to
give our "x" and y coordinates.

then we take the atan y/x           (atan2(y, x) in SDL) to get the angle.
As you can see from the green lines, you go from -pi/2 to pi/2

Next, we add pi/2 to go from 0 to pi, and dive it all by pi to go from 0 to 1
(purple lines)

Multiplying by tau, we get a full 2*pi radians around the circle (red lines)

Applying the Helix function, we switch between radii of 0.5 and 1, based upon
using modulo to select () the number of grooves we want in our rifling (g)
(orange lines)

https://www.desmos.com/calculator/wa4avaopd1

- BW


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.