|
|
Alain Martel <kua### [at] videotronca> wrote:
> > My current WIP (Scrabble) had a need for a helix that I could texture, and I
> > could not find one in Inigo Quilez article on distance functions, so I decided
> > to create one myself using his basic principles.
> >
> > I started just sing a circular cross section, but as you can see from the image,
> > I abstracted it so you can supply any 2D cross-section SDF, (this one is a
> > simple 2D square that I rotated 45 degrees).
> >
> > Since it is an SDF, applying textures by adding noise works as expected.
> >
> > The updated libisoshapes.inc is in GitHub now:
> > https://github.com/carath63/povlibrary
> >
> > -- Chris R
>
> You should take a look at the f_helix1(x,y,z, Num_Helix, Period,
> Minor_radius, Major_radius, Shape, Cross_section, Section_Rotation)
> functions from functions.inc
>
> Playing with the last three parameters affect the shape of the helix.
> Shape : Not sure what it does
> Cross_section determine how many sides the cross section have
> Section_Rotation rotates the cross section.
>
> f_helix2 works the same, but, the Num_Helix and Shape parameter are not
> used.
I have used both of these in the past. I always find it tricky to get the
parameters to work correctly at different scales. I haven't looked at the
implementation of f_helix, but I know some of the other built-ins are not
implemented as exact SDF functions, which makes applying a surface texture to
the shape more difficult. I'm also finding that exact SDF functions render as
isosurfaces more quickly than inexact methods I have used in the past. These
functions also have limited shape options for the cross section, while mine can
take any function(x,y) that is also an exact 2D SDF.
Plus, it's always fun to go invent something on your own...
-- Chris R
Post a reply to this message
|
|