POV-Ray : Newsgroups : povray.general : Stupid math question, epic fail! : Re: Stupid math question, epic fail! Server Time
29 Jul 2024 18:30:52 EDT (-0400)
  Re: Stupid math question, epic fail!  
From: Jaap Frank
Date: 27 Oct 2010 11:48:05
Message: <4cc849b5$1@news.povray.org>
"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.