POV-Ray : Newsgroups : povray.text.scene-files : Fractal Macro Server Time
23 Dec 2024 22:12:16 EST (-0500)
  Fractal Macro (Message 1 to 10 of 10)  
From: SamuelT 
Subject: Fractal Macro
Date: 2 May 2000 22:41:25
Message: <390F9241.A171D38E@aol.com>
See povray.binaries.images for an image.

#macro Curser( L )

  cone{<0,0,0>,.125,<0,1,0>,(.125*.6) pigment{rgb 1}}

  #if (L > 0)
    #local New_L = L - 1;

    union{
     Curser(New_L) sphere{0,.01 pigment{rgb 0}}
     scale .65 rotate y*45 translate y*1
    }
    union{
     Curser(New_L) sphere{0,.01 pigment{rgb 0}}
     scale .65 rotate<0,45,90> translate y*1
    }
    union{
     Curser(New_L) sphere{0,.01 pigment{rgb 0}}
     scale .65 rotate<0,45,-90> translate y*1
    }

  #end

  #if(New_L<1) torus{.2,.1 pigment{rgb<.15 .8 .3>} finish{diffuse .9}
translate y*1} #end

#end


--
Samuel Benge

E-Mail: STB### [at] aolcom

Visit the still unfinished isosurface tutorial:
http://members.aol.com/stbenge


Post a reply to this message

From: Tony Micklus
Subject: Re: Fractal Macro
Date: 9 May 2000 14:08:51
Message: <39185433$1@news.povray.org>
Hi Samuel,

I am new to this newsgroup I have been playing with POV-Ray for about 6
months. I am trying to understand fractals and I came across your code which
has helped a lot but I have a few questions to ask if you would answer them.

1..Your cone statement has a radius of (.125*.6) why are the numbers
seperated why not make the radius .075?

2...When rendering  the image the radii of the cones and torii get
progressively smaller yet I all your radii are constants. What is it that
causes them to get smaller?

>
>#macro Curser( L )
>
>  cone{<0,0,0>,.125,<0,1,0>,(.125*.6) pigment{rgb 1}}
>
>  #if (L > 0)
>    #local New_L = L - 1;
>
>    union{
>     Curser(New_L) sphere{0,.01 pigment{rgb 0}}
>     scale .65 rotate y*45 translate y*1
>    }
>    union{
>     Curser(New_L) sphere{0,.01 pigment{rgb 0}}
>     scale .65 rotate<0,45,90> translate y*1
>    }
>    union{
>     Curser(New_L) sphere{0,.01 pigment{rgb 0}}
>     scale .65 rotate<0,45,-90> translate y*1
>    }
>
>  #end
>
>  #if(New_L<1) torus{.2,.1 pigment{rgb<.15 .8 .3>} finish{diffuse .9}
>translate y*1} #end
>
>#end
>


Post a reply to this message

From: Warp
Subject: Re: Fractal Macro
Date: 10 May 2000 05:53:04
Message: <39193180@news.povray.org>
Tony Micklus <ton### [at] j4tbcom> wrote:
: 1..Your cone statement has a radius of (.125*.6) why are the numbers
: seperated why not make the radius .075?

  I think it's just easier to understand for him (and for anyone trying to
read the code) that way.
  For example, if I have something that's usually 2.5 units long, and then
I want that same thing half that long, it's easier to read if I write
"2.5*0.5" (or "2.5/2") instead of "1.25".

: 2...When rendering  the image the radii of the cones and torii get
: progressively smaller yet I all your radii are constants. What is it that
: causes them to get smaller?

  The scaling is done recursively, ie. the same "scale .65" is applied
several times to the objects. That's what's making them smaller.
  If you thing about it, what happens is something like this:

union
{ union
  { object { MyObject }
    object { MyObject }
    scale .65
  }
  object { MyObject }
  scale .65
}

  The objects in the inner union will get smaller than the object in the
outer union because the former are scaled twice by 0.65, ie. they are
actually scaled by 0.65*0.65 = 0.4225.
  It may be a bit hard to see this in the original code because the
objects in the inner unions are generated by a recursive macro call.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ken
Subject: Re: Fractal Macro
Date: 10 May 2000 07:51:40
Message: <39194CC7.D3C3FDD8@pacbell.net>
Warp wrote:

>   For example, if I have something that's usually 2.5 units long, and then
> I want that same thing half that long, it's easier to read if I write
> "2.5*0.5" (or "2.5/2") instead of "1.25".

That is ridiculous.

-- 
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Warp
Subject: Re: Fractal Macro
Date: 10 May 2000 10:10:47
Message: <39196de6@news.povray.org>
Ken <tyl### [at] pacbellnet> wrote:
: That is ridiculous.

  Why?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ken
Subject: Re: Fractal Macro
Date: 10 May 2000 11:25:26
Message: <39197EE2.28730AEA@pacbell.net>
Warp wrote:
> 
> Ken <tyl### [at] pacbellnet> wrote:
> : That is ridiculous.
> 
>   Why?

Maybe you are some sort of mathematical genius but for me I have
absolutely no capacity for doing math functions in my head.

Take for example 2/1.2978

Can you do that without paper or a calculator ?

Maybe you can but I would rather have a real number to look at than
have to work out the equation. Especially if it's been a while since
I have worked on the scene.

-- 
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Warp
Subject: Re: Fractal Macro
Date: 10 May 2000 11:48:28
Message: <391984cc@news.povray.org>
Ken <tyl### [at] pacbellnet> wrote:
: Maybe you are some sort of mathematical genius but for me I have
: absolutely no capacity for doing math functions in my head.

: Take for example 2/1.2978

: Can you do that without paper or a calculator ?

  Why should I?
  I'm not interested on how much is 2.5/2. I don't give a damn, actually.
I'm only interested in that I want a half of that size. Why should I
calculate how much is the half of 2.5 when I can let povray do it for me?
And besides, it will be easier to understand that I wanted a half of that
measure there. From "1.25" is a bit harder to see that it's actually one
half of "2.5".
  If I later decide to change it to 2.7, it will be very easy to change the
half-measure to "2.7/2". I don't have to calculate how much actually is
27/2.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: SamuelT 
Subject: Re: Fractal Macro
Date: 11 May 2000 23:33:30
Message: <391B7C06.89391388@aol.com>
Your right on the dot, Warp. It's also to change the code faster if I want the
cones to shrink at a higher rate.

Warp wrote:

> Tony Micklus <ton### [at] j4tbcom> wrote:
> : 1..Your cone statement has a radius of (.125*.6) why are the numbers
> : seperated why not make the radius .075?
>
>   I think it's just easier to understand for him (and for anyone trying to
> read the code) that way.
>   For example, if I have something that's usually 2.5 units long, and then
> I want that same thing half that long, it's easier to read if I write
> "2.5*0.5" (or "2.5/2") instead of "1.25".

--
Samuel Benge

E-Mail: STB### [at] aolcom

Visit my isosurface tutorial at http://members.aol.com/stbenge


Post a reply to this message

From: SamuelT 
Subject: Re: Fractal Macro
Date: 11 May 2000 23:38:11
Message: <391B7D1F.51D7FF90@aol.com>
Another reason I used (.125/6) for the second cone radius is that the macro
is shrinking at the same rate (scale .6). Although looking back at the code
I see I forgot to update the macro's scale. It is at scale .65.

Ken wrote:

> Warp wrote:
> >
> > Ken <tyl### [at] pacbellnet> wrote:
> > : That is ridiculous.
> >
> >   Why?
>
> Maybe you are some sort of mathematical genius but for me I have
> absolutely no capacity for doing math functions in my head.
>
> Take for example 2/1.2978
>
> Can you do that without paper or a calculator ?
>
> Maybe you can but I would rather have a real number to look at than
> have to work out the equation. Especially if it's been a while since
> I have worked on the scene.
>
> --
> Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
> http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/

--
Samuel Benge

E-Mail: STB### [at] aolcom

Visit my isosurface tutorial at http://members.aol.com/stbenge


Post a reply to this message

From: Warp
Subject: Re: Fractal Macro
Date: 12 May 2000 04:40:27
Message: <391bc37a@news.povray.org>
SamuelT. <STB### [at] aolcom> wrote:
: Your right on the dot, Warp. It's also to change the code faster if I want the
: cones to shrink at a higher rate.

  Of course the right way of doing this is to declare an identifier. This
way you can change just this identifier and that's it. And you also allow
the user to do it easyly.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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