POV-Ray : Newsgroups : povray.advanced-users : Spiralled object with a decreasing radius Server Time
24 Nov 2024 09:43:45 EST (-0500)
  Spiralled object with a decreasing radius (Message 1 to 4 of 4)  
From: Mock26
Subject: Spiralled object with a decreasing radius
Date: 23 Apr 2007 19:50:01
Message: <web.462d4452550713307a0e9df90@news.povray.org>
I would first like to thank Julius Klatte for posting some spiral tutorials
on his website (http://members.tripod.com/~klatte/pov/helix.html).  All
credit for the following information belongs to him.

His basic tutorial is as follows:

camera { location <0,2,-10> look_at <0,0,0> }
light_source { <-30,40,-50> rgb 1 }
light_source { <60,20,-30> rgb 1 }

#declare Tex = texture { pigment { color rgb <0.95,0.65,0.55> } finish {
phong 1 phong_size 100 } }
#declare S = sphere { 0, 0.25 texture { Tex } }

#declare Precision = 0.5;
union {
  #declare T = 0;
  #while (T<360)
    object { S translate <0,T/180,-2> rotate 4*y*T }
    #local T = T + 1/Precision;
  #end
rotate x*-20 }



Now, my question is, "Is there is any way to cause each subsequent sphere to
have a smaller or larger diameter than the one before it?"

Unfortunately, I'm only just dabbling with macro's and such and I'm not all
that good at it.  I can understand this macro only because Julius Klatte
explains it very well and "breaking it down" backwards isn't that hard for
me.  However, trying to create my own macro, even using his as a guide, is
a bit beyond me at the moment.  I appreciate any help that anyone can offer
on this, especially if it is in the form of a macro that I can copy and
paste into my POV file!  Thanks!


Take care and have a great day....



ciao,
john.


Post a reply to this message

From: Charles C
Subject: Re: Spiralled object with a decreasing radius
Date: 23 Apr 2007 20:25:01
Message: <web.462d4c272acc8fd8b160ffde0@news.povray.org>
"Mock26" <nomail@nomail> wrote:
> I would first like to thank Julius Klatte for posting some spiral tutorials
> on his website (http://members.tripod.com/~klatte/pov/helix.html).  All
> credit for the following information belongs to him.
>
> His basic tutorial is as follows:
>
> camera { location <0,2,-10> look_at <0,0,0> }
> light_source { <-30,40,-50> rgb 1 }
> light_source { <60,20,-30> rgb 1 }
>
> #declare Tex = texture { pigment { color rgb <0.95,0.65,0.55> } finish {
> phong 1 phong_size 100 } }
> #declare S = sphere { 0, 0.25 texture { Tex } }
>
> #declare Precision = 0.5;
> union {
>   #declare T = 0;
>   #while (T<360)
>     object { S translate <0,T/180,-2> rotate 4*y*T }
>     #local T = T + 1/Precision;
>   #end
> rotate x*-20 }
>
>
>
> Now, my question is, "Is there is any way to cause each subsequent sphere to
> have a smaller or larger diameter than the one before it?"
>
> Unfortunately, I'm only just dabbling with macro's and such and I'm not all
> that good at it.  I can understand this macro only because Julius Klatte
> explains it very well and "breaking it down" backwards isn't that hard for
> me.  However, trying to create my own macro, even using his as a guide, is
> a bit beyond me at the moment.  I appreciate any help that anyone can offer
> on this, especially if it is in the form of a macro that I can copy and
> paste into my POV file!  Thanks!
>
>
> Take care and have a great day....
>
>
>
> ciao,
> john.


Yes.  Right now you're translating it using the changing variable T.  All
you need to do is also scale it by something that changes with T.  Just
make sure you scale before you translate or the scale will affect the
position of the sphere as well.   E.g:
>     object { S scale 1.5-T/360 translate <0,T/180,-2> rotate 4*y*T }

or whatever numbers look good.

Charles


Post a reply to this message

From: Mock26
Subject: Re: Spiralled object with a decreasing radius
Date: 23 Apr 2007 21:05:02
Message: <web.462d57a72acc8fd87a0e9df90@news.povray.org>
"Charles C" <nomail@nomail> wrote:
> "Mock26" <nomail@nomail> wrote:
> > I would first like to thank Julius Klatte for posting some spiral tutorials
> > on his website (http://members.tripod.com/~klatte/pov/helix.html).  All
> > credit for the following information belongs to him.
> >
> > His basic tutorial is as follows:
> >
> > camera { location <0,2,-10> look_at <0,0,0> }
> > light_source { <-30,40,-50> rgb 1 }
> > light_source { <60,20,-30> rgb 1 }
> >
> > #declare Tex = texture { pigment { color rgb <0.95,0.65,0.55> } finish {
> > phong 1 phong_size 100 } }
> > #declare S = sphere { 0, 0.25 texture { Tex } }
> >
> > #declare Precision = 0.5;
> > union {
> >   #declare T = 0;
> >   #while (T<360)
> >     object { S translate <0,T/180,-2> rotate 4*y*T }
> >     #local T = T + 1/Precision;
> >   #end
> > rotate x*-20 }
> >
> >
> >
> > Now, my question is, "Is there is any way to cause each subsequent sphere to
> > have a smaller or larger diameter than the one before it?"
> >
> > Unfortunately, I'm only just dabbling with macro's and such and I'm not all
> > that good at it.  I can understand this macro only because Julius Klatte
> > explains it very well and "breaking it down" backwards isn't that hard for
> > me.  However, trying to create my own macro, even using his as a guide, is
> > a bit beyond me at the moment.  I appreciate any help that anyone can offer
> > on this, especially if it is in the form of a macro that I can copy and
> > paste into my POV file!  Thanks!
> >
> >
> > Take care and have a great day....
> >
> >
> >
> > ciao,
> > john.
>
>
> Yes.  Right now you're translating it using the changing variable T.  All
> you need to do is also scale it by something that changes with T.  Just
> make sure you scale before you translate or the scale will affect the
> position of the sphere as well.   E.g:
> >     object { S scale 1.5-T/360 translate <0,T/180,-2> rotate 4*y*T }
>
> or whatever numbers look good.
>
> Charles

Woot!

Thanks, Charles!  I was messing around with scale, but I just didn't know
the correct formula for it.  Thanks again!


Take care and have a great day....



ciao,
john.


Post a reply to this message

From: Mark Weyer
Subject: Re: Spiralled object with a decreasing radius
Date: 24 Apr 2007 08:05:02
Message: <web.462df15c2acc8fd8fddaa4670@news.povray.org>
> #declare Tex = texture { pigment { color rgb <0.95,0.65,0.55> } finish {
> phong 1 phong_size 100 } }
> #declare S = sphere { 0, 0.25 texture { Tex } }
>
> #declare Precision = 0.5;
> union {
>   #declare T = 0;
>   #while (T<360)
>     object { S translate <0,T/180,-2> rotate 4*y*T }
>     #local T = T + 1/Precision;
>   #end
> rotate x*-20 }
>
> Now, my question is, "Is there is any way to cause each subsequent sphere to
> have a smaller or larger diameter than the one before it?"

Replace the "#declare S" and "object" lines by

  #macro S(T) = sphere {0, (something that depends on T) texture {Tex}}
  object {S(T) translate <0,T/180,-2> rotate 4*y*T}

On a side note you may want to look into the sphere_sweep object. That one
can help you reduce Precision while improving accuracy.

Best regards,

  Mark Weyer


Post a reply to this message

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