POV-Ray : Newsgroups : povray.general : Stupid math question, epic fail! Server Time
1 Nov 2024 21:22:12 EDT (-0400)
  Stupid math question, epic fail! (Message 1 to 4 of 4)  
From: Steve Martell
Subject: Stupid math question, epic fail!
Date: 25 Oct 2010 23:10:01
Message: <web.4cc646765a7741fd661a07080@news.povray.org>
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.

Here's what I'm using:

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

#while (Theta < 2*pi*10 )

      sphere { <0,0,0>, .05 texture { T_Stone3 } translate
<cos(Theta)*sin(Phi),abs(cos(Phi)),sin(Theta)*sin(Phi)> }

    #declare Theta = Theta + pi/120;
    #declare Phi = Phi + pi/12;

#end

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!


Post a reply to this message

From: Le Forgeron
Subject: Re: Stupid math question, epic fail!
Date: 26 Oct 2010 03:07:25
Message: <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!

Indents on golf-ball are subject to patents (sad, but true).
Usual approach is to use a icosahedron, each vertex is a 5 neighbors
circle. Then you subdivide each triangle (equilateral) with 6 neighbors
circles (up to you for the number of circles in each triangle (including
the 3 of the vertices), their number can be 3,6,10,15,21,28,...
(traditional triangular number)
Then you project each triangle on the sphere in respect to the sphere's
center (the icosahedron's center and sphere's center are at the same
point), and that generate the centers of all your indents (as the
projection of the center of each circle).
To make indent with CSG, add a bit on the length from the center of the
indent to the center of the sphere (that bit being smaller than the
radius of the spherical indent)

-- 
A: Because it messes up the order in which people normally read text.<br/>
Q: Why is it such a bad thing?<br/>
A: Top-posting.<br/>
Q: What is the most annoying thing on usenet and in e-mail?


Post a reply to this message

From: Jaap Frank
Subject: Re: Stupid math question, epic fail!
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

From: Steve Martell
Subject: Re: Stupid math question, epic fail!
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.