|
|
William F Pokorny <ano### [at] anonymousorg> wrote:
> One thing I'd like to do in yuqk is dump the two inbuilt spiral patterns
> for more general, tapered spiral warping as one or more additional
> options of the warp{} mechanism.
Just search "shadertoy spiral" and you'll be there for hours. ;)
https://www.shadertoy.com/user/FabriceNeyret2 is your guy.
Maybe if we reached out to him, he might have some interest in seeing what we do
here...
> We have too f_spiral() - which has issues - as you well know. The
> solutions to which, I believe, sit more with some sort of general
> tapered warping capability.
Well, f_spiral, I think - was just something to make an isosurface type thing.
I think we could probably use some general spiral equations and implement the
tubular function approach for things like that.
Speaking of functions, it would probably be a good idea if you're implementing
inbuilt functions to have some mechanism by which to get the 1st and 2nd
derivatives, or a tangent to a point using a numerical approach --- useful
things to have that make coding a scene & orienting shapes a thousand times
easier for people.
With regard to warps and spirals, I finally got that spiral warp worked out,
which is just a rotation matrix with a falloff function.
Perhaps you could play with a general warp mechanism which takes a
transformation matrix and a falloff function and pairs them up to make a warp.
You could have 2D warps, 3D warps (like my tornado), etc.
I also absolutely think that we need to have a geometric inversion function,
since I think it's something that would inspire a LOT of experimentation, cool
scenes, novel approaches, animations, and all manner of things I can't possibly
predict.
Ditto FFT. Have it take a start, stop, and function (especially spline), and
have it output an array.
> Aside: We can today implement a limited form of the sort of spiral - I
> think you're implementing - with a series of half arc functions (there
> is too the new-ish list_object pattern in yuqk which could use the torus
> or functions via coded isosurfaces(a) (inside tests)). This approach,
> however, slows down significantly on the addition of each half arc.
Bah. No need to do any such thing when doing it analytically it so
straightforward.
> (a) The inside test of 'isosurface shapes' is relatively fast when used
> for object based patterns. It's just whether the function returns a
> negative value or not at a given location. In fact, 'isosurface shapes
> for inside test purposes' do not need to be good isosurfaces with
> respect to being render-able as actual shapes!
True. That might be a good point to make in the documentation.
- BW
The basic Archimedean spiral is just:
#declare Distance = function (X, Y, Z) {sqrt (X*X+Y*Y+Z*Z)}
#declare fmod = function (Value, Modulo) {select (Value, 1 - mod (abs (Value),
Modulo), mod (abs (Value), Modulo))} // this gives a mod function that remains
consistant across the origin
#declare Sqr = function (N) {N*N}
#declare ArmSpacing = 0.004;
#declare LineThickness = 0.0004;
#declare Aspect = image_width/image_height;
#declare U = function {x/image_width*Aspect}
#declare V = function {y/image_height}
#declare Angle = function {atan2 (V(x,y,z), U(x,y,z))}
#declare l = function {Distance (U(x,y,z), V(x,y,z), 0)}
#declare Offset = function {l(x,y,z) + ArmSpacing * (Angle(x,y,z)/(tau))}
#declare circles = function {fmod (Offset(x,y,z), ArmSpacing)}
#declare FracTurn = function {abs (l(x,y,z)/ArmSpacing - Angle(x,y,z)/(tau))}
#declare ArcLength = function (b, _Theta) {b/2 * (_Theta * sqrt (1 +
_Theta*_Theta) + ln (_Theta + sqrt (1 + _Theta*_Theta)))}
#declare f_Spiral = function {select (circles (x,y,z) - LineThickness, 0, 1)}
Plenty of other spirals out there to code up and experiment with, once I get
some of this other heavy-lifting out of the way.
Maybe we could/should have a website topic every month / quarter, and solicit
submissions for algorithms, functions, patterns, renders, etc. and have
something new and fresh on the POV-Ray homepage.
(I still think that getting out there on social media, and promoting POV-Ray is
the way forward wrt to finding new talent, and new people to help write source
so that we can fix bugs, add new features, and brainstorm a workable fresh start
with 4.0.)
- BW
Post a reply to this message
|
|
|
|
William F Pokorny <ano### [at] anonymousorg> wrote:
> On the "bah" comment. One of the things our current spiral capability
> doesn't do well is start and stop exactly where we want it to - in a
> clean way. We have hard starts and stops on numerical limits or by
> fading the effect in or out. The piecemeal assembly of spirals does fill
> a need for clean, limited duration, spirals - admittedly by default! :-)
Humbug.
The spiral equations are analytical, and therefore ought to lend themselves to
directly limiting the radius or arc length of the generated spiral.
It would be a simple matter of experimenting, asking a shadertoy coder, or
posting a request on stackoverflow or similar smarty-pants site for a way to
limit the rendered spiral's domain.
I have wide-ranging interests, a fertile and sometimes overactive imagination,
usually shallow pockets, and a disdain for people telling me what I can't or
especially am not allowed to do.
Which means that somehow, some way, eventually, _I'll find a way_.
I've done it with making a commercial database using only an open source
spreadsheet, and I've done it will full-color (almost) tileable Voronoi using
only functions.
Spirals ought to be easy.
I haven't even investigated implementing a SDF for the spiral, but I know it's
possible.
- BW
It would be nice to have a wish-list that operated something like a c++ list -
where things could be added onto the list and then removed (or marked as done),
so that people could scroll through it if they were bored and looking for
something to do. ;)
Maybe enable tags to assign priority or difficulty levels, etc.
(Similar to bug-reporting 3rd party services like FlySpray, do they have
feature-request maintaining services?)
[Oh, right, I guess they do - it's called "SaaS"]
Post a reply to this message
|
|