POV-Ray : Newsgroups : povray.general : Stupid math question, epic fail! : Re: Stupid math question, epic fail! Server Time
29 Jul 2024 18:29:39 EDT (-0400)
  Re: Stupid math question, epic fail!  
From: Steve Martell
Date: 28 Oct 2010 10:25:00
Message: <web.4cc986dd86cf338c661a07080@news.povray.org>
Exactly what I was looking for!

sphere { <0,0,0>, 1 pigment {Red} }

#declare Theta=0;
#declare Phi = 0;

#while (Theta < 2*pi*8    )

    sphere { <0,0,0>,.05 texture {T_Stone6} translate
<cos(Theta)*cos(Phi),abs(sin(Phi)),sin(Theta)*cos(Phi)>  }
    #declare Theta = Theta + pi/12;
    #declare Phi = Phi + pi/384;
    #if (Phi > pi/2)
      #declare Phi = 0;
    #end
#end

Gives me what I want, and it's just a matter of tweaking the Theta bound and the
relationship between Phi and Theta's step-ups.  Basically, it's the Theta bound
multiplier (in this case, 16) times the Theta's step (12), times 2.

Perfect!



"Jaap Frank" <jjf### [at] casemanl> wrote:
> "Le_Forgeron" <lef### [at] freefr> wrote in message
> news:4cc67e2d$1@news.povray.org...
> > Le 26/10/2010 05:09, Steve Martell a écrit :
> >> So...
> >>
> >> All I want to do is start out at <1,0,0> and spiral up to the top of a
> >> hemisphere.  I want to be able to vary the vertical step up (via angle,
> >> of
> >> course) and the horizontal step.  I can make plain old vertical columnar
> >> spirals
> >> all day long, but I'm just not getting the translation for the
> >> hemisphere.  The
> >> eqs I have found online aren't quite doing what I want - I get fancy loxo
> >> things, but not just a nice spiral.
> >
> > loxodrom is the spiral on a sphere when driven by only the spiral
> > constant angle.
> > So if your only constant parameter is the angle, you would get a
> > loxodrom (which also mean it never reach the pole exactly)
> >
> >> If I leave the Phi out of it all, just using the X and Z, I get my nice
> >> columnar
> >> spirals.  Nice if I want to make car springs, that is!  I am going to use
> >> this
> >> to make indents on a golfball, but it is really just a concept struggle
> >> at this
> >> point.  I just want a nice, adjustable, hemispherical spiral!  Argh!
> >
> What you want is this:
> ***********************************
> light_source {
>   0*x                  // light's position (translated below)
>   color rgb <1,1,1>    // light's color
>   translate <-20, 40, -20>
> }
> camera {
>   location  <0.0, 2.0, -5.0>
>   look_at   <0.0, 0.0,  0.0>
>   right     x*image_width/image_height
> }
> #declare Theta = 0;
> #declare Phi = 0;
> #while (Theta < 2*pi*10 )
>       sphere { <0,0,0>, .05
>       texture { pigment {color rgb 1 }}
>       translate <cos(Theta)*cos(Phi),abs(sin(Phi)),sin(Theta)*cos(Phi)> }
>     #declare Theta = Theta + pi/10;
>     #declare Phi = Phi + pi/400;
> #end
> ***********************************
> You exchanged cos and sin for the Phi.
> Further sin(Phi) must not exceed 90 degrees or 0.5*pi.
>
> The only problem with this aproach is that the distance higher up the
> hemisphere  becomes smaller and smaller.
> The solution of  Le_Forgeron hasn't that problem.
>
> Succes,
>
> Jaap Frank


Post a reply to this message

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