|
|
> 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
|
|