POV-Ray : Newsgroups : povray.advanced-users : Advanced script, idea/help. Server Time
4 Nov 2024 19:22:22 EST (-0500)
  Advanced script, idea/help. (Message 1 to 10 of 14)  
Goto Latest 10 Messages Next 4 Messages >>>
From: Spider
Subject: Advanced script, idea/help.
Date: 18 Apr 1999 13:15:14
Message: <371A0393.9EE2D65E@bahnhof.se>
Hello.
I've been working around in my old demo programming libraries, and found a nice
"so called" fractal effect, where you created an image consisting of lines. 
A base line, the angle of this line upwards, and one or more intersecting lines
for this one. With the angles set.

This creation was then applied to all ends of itself(a new copy on each line
end). the procedure was repeated a limited amount of time, and in the end you
had a nice "tree/bush" creation(and some other very interesting things).

Now I'm thinking loosly on creating something like this in POV, but for the
moment I have no idea on how to do it. 

Anyone get the concept, care to come with ideas?


-- 
//Spider
        [ spi### [at] bahnhofse ]-[ http://www.bahnhof.se/~spider/ ]
What I can do and what I could do, I just don't know anymore
                "Marian"
        By: "Sisters Of Mercy"


Post a reply to this message

From: Margus Ramst
Subject: Re: Advanced script, idea/help.
Date: 18 Apr 1999 14:06:01
Message: <371a10f9.0@news.povray.org>
I don't thin you have to stick "advanced" to every heading simply to justify
posting here :)

Anyway, what you want seems simple enough. I won't discuss making the
initial object. But as for adding it recursively - here's how I imagine it:

You first generate the 1st level object. Save all the end points _and_
directions of the respective branches in an array.
Now, take a point in the array, and scale, rotate & translate both your 1st
level object - and all the points & directions in the array - relative to
the current point and the corresponding direction.
You now have a second-level instance of the object and its end
points/directions. Repeat the process to the desired recursion level,
similar to the "pyramid" example macro...

I know this didn't come out all that well. Hopefully you got the main idea.
I'll try to create an example macro when I have more time.

Margus

Spider wrote in message <371A0393.9EE2D65E@bahnhof.se>...
>Hello.
>I've been working around in my old demo programming libraries, and found a
nice
>"so called" fractal effect, where you created an image consisting of lines.
>A base line, the angle of this line upwards, and one or more intersecting
lines
>for this one. With the angles set.
>
>This creation was then applied to all ends of itself(a new copy on each
line
>end). the procedure was repeated a limited amount of time, and in the end
you
>had a nice "tree/bush" creation(and some other very interesting things).
>
>Now I'm thinking loosly on creating something like this in POV, but for the
>moment I have no idea on how to do it.
>
>Anyone get the concept, care to come with ideas?
>
>
>--
>//Spider
>        [ spi### [at] bahnhofse ]-[ http://www.bahnhof.se/~spider/ ]
>What I can do and what I could do, I just don't know anymore
>                "Marian"
>        By: "Sisters Of Mercy"
>


Post a reply to this message

From: Margus Ramst
Subject: Re: Advanced script, idea/help.
Date: 18 Apr 1999 14:23:29
Message: <371a1511.0@news.povray.org>
Wait, wait!!
Better yet, just re-initiate the 1st-level-object-creating-macro <ahem>
every time you reach an end point. Provided you also re-initiate the random
number stream with the same seed in every instance, you get identical
values. Just a matter of changing the overall scale and direction for each
instance/recursion level; these should therefore be params of the macro.
So it's really very similar to the recursive pyramid and sphereflake macros.

Margus

Margus Ramst wrote in message <371a10f9.0@news.povray.org>...
>I don't thin you have to stick "advanced" to every heading simply to
justify
>posting here :)
>
>Anyway, what you want seems simple enough. I won't discuss making the
>initial object. But as for adding it recursively - here's how I imagine it:
>
>You first generate the 1st level object. Save all the end points _and_
>directions of the respective branches in an array.
>Now, take a point in the array, and scale, rotate & translate both your 1st
>level object - and all the points & directions in the array - relative to
>the current point and the corresponding direction.
>You now have a second-level instance of the object and its end
>points/directions. Repeat the process to the desired recursion level,
>similar to the "pyramid" example macro...
>
>I know this didn't come out all that well. Hopefully you got the main idea.
>I'll try to create an example macro when I have more time.
>
>Margus
>


Post a reply to this message

From: Spider
Subject: Re: Script, idea/help.
Date: 18 Apr 1999 14:27:58
Message: <371A14F0.2171AD73@bahnhof.se>
Well, I get your points very well, and so far i'm with you, but what I'm after
is to make a bit more general implementation, ie. how to make it work on several
shapes that aren't identified.
I'd need some kind of data-structure in an array, like this.

shape[0..10] //10 points, 0 is always the lowest, the rest can be anything 
else.
in each point you'll need:
position : (0 for the lowest, <0 for nonexisting=
angle:	At  what angle does it point
length : How long is it.

This could be rather easy to implement in a pov script, like :

//Must be #declare for #macros to access it.
#declare arr = array[10][3]
10 is the index, what point are we talking about.
3 are the elements, theese should be vectors
(Point, Angle, Length)
#declare cPoint = 0;
#declare cAngle = 1;
#declare cLength = 2;

#macro init()
  #local I = 0;
  #while(I<10)
    //Don't loop, this is faster.
    #declare arr[I][cPoint] = <-1,-1,-1>;
    #declare arr[I][cAngle] = <0,0,0>;
    #declare arr[I][cLength] = <0,0,0>;
    #local I = I + 1;
  #end
#end
And to set a point, you'd only need to loop the array and look for the first
unset point.

To implement this I'd need to do it with Cylinders, but my problem is, how to
utilize the angle...

Ok, I think I got it as I typed here...
This is only ideas..

#macro Draw(Level)
  #if(Level>0)
    union {
      #local I = 0;
      #while(I<10)
        #if(!arr[I][cPoint]=<-1,-1,-1>)
          cylinder {
            <0,0,0>, arr[I][cLength], 0.25
            rotate arr[I][cAngle]
            translate arr[I][cPoint]
          }
          object { 
            Draw(Level-1)
	    rotate arr[I][cLength]
            rotate arr[I][cAngle]
            translate arr[I][cPoint]
          }
        #end
        #local I = I + 1;
      #end
    }
  #end
#end

I'll have to test this further.
(can't do so now, POV is wooooorking. *doh*)
(been doing so for 4 hours now, still parsing)

Any ideas/comments before I develop ?
(anyone else want to do it, do it ,-)


Margus Ramst wrote:
> 
> I don't thin you have to stick "advanced" to every heading simply to justify
> posting here :)
> 
> Anyway, what you want seems simple enough. I won't discuss making the
> initial object. But as for adding it recursively - here's how I imagine it:
> 
> You first generate the 1st level object. Save all the end points _and_
> directions of the respective branches in an array.
> Now, take a point in the array, and scale, rotate & translate both your 1st
> level object - and all the points & directions in the array - relative to
> the current point and the corresponding direction.
> You now have a second-level instance of the object and its end
> points/directions. Repeat the process to the desired recursion level,
> similar to the "pyramid" example macro...
> 
> I know this didn't come out all that well. Hopefully you got the main idea.
> I'll try to create an example macro when I have more time.
> 
> Margus
> 
> Spider wrote in message <371A0393.9EE2D65E@bahnhof.se>...
> >Hello.
> >I've been working around in my old demo programming libraries, and found a
> nice
> >"so called" fractal effect, where you created an image consisting of lines.
> >A base line, the angle of this line upwards, and one or more intersecting
> lines
> >for this one. With the angles set.
> >
> >This creation was then applied to all ends of itself(a new copy on each
> line
> >end). the procedure was repeated a limited amount of time, and in the end
> you
> >had a nice "tree/bush" creation(and some other very interesting things).
> >
> >Now I'm thinking loosly on creating something like this in POV, but for the
> >moment I have no idea on how to do it.
> >
> >Anyone get the concept, care to come with ideas?
> >
> >
> >--
> >//Spider
> >        [ spi### [at] bahnhofse ]-[ http://www.bahnhof.se/~spider/ ]
> >What I can do and what I could do, I just don't know anymore
> >                "Marian"
> >        By: "Sisters Of Mercy"
> >

-- 
//Spider
        [ spi### [at] bahnhofse ]-[ http://www.bahnhof.se/~spider/ ]
What I can do and what I could do, I just don't know anymore
                "Marian"
        By: "Sisters Of Mercy"


Post a reply to this message

From: Spider
Subject: Re: Advanced script, idea/help.
Date: 18 Apr 1999 14:38:58
Message: <371A1791.A8A296CD@bahnhof.se>
Take a peek at the code and see, I think that would be something of what you
intended, isn't it?

-- 
//Spider
        [ spi### [at] bahnhofse ]-[ http://www.bahnhof.se/~spider/ ]
What I can do and what I could do, I just don't know anymore
                "Marian"
        By: "Sisters Of Mercy"


Post a reply to this message

From: Spider
Subject: Re: Advanced script, idea/help.
Date: 18 Apr 1999 16:32:00
Message: <371A3199.FA664B73@bahnhof.se>
Solved it.
see p.b.i.

-- 
//Spider
        [ spi### [at] bahnhofse ]-[ http://www.bahnhof.se/~spider/ ]
What I can do and what I could do, I just don't know anymore
                "Marian"
        By: "Sisters Of Mercy"


Post a reply to this message

From: Spider
Subject: Re: Script, idea/help.
Date: 18 Apr 1999 17:41:18
Message: <371A4244.B1632A1@bahnhof.se>
look in povray.text.scene-files for an include.
mail me or post here for help/tips.



-- 
//Spider
        [ spi### [at] bahnhofse ]-[ http://www.bahnhof.se/~spider/ ]
What I can do and what I could do, I just don't know anymore
                "Marian"
        By: "Sisters Of Mercy"


Post a reply to this message

From: Margus Ramst
Subject: Re: Script, idea/help.
Date: 18 Apr 1999 18:37:39
Message: <371a50a3.0@news.povray.org>
I'll check it out. But perhaps you could point out what parts of the macro,
in your opinion, need improving - and in what way? What is the goal you wish
to achieve?

Margus

Spider wrote in message <371### [at] bahnhofse>...
>look in povray.text.scene-files for an include.
>mail me or post here for help/tips.
>
>
>
>--
>//Spider
>        [ spi### [at] bahnhofse ]-[ http://www.bahnhof.se/~spider/ ]
>What I can do and what I could do, I just don't know anymore
>                "Marian"
>        By: "Sisters Of Mercy"


Post a reply to this message

From: Ken
Subject: Re: Script, idea/help.
Date: 18 Apr 1999 19:37:48
Message: <371A5D5B.861848D2@pacbell.net>
Spider wrote:
> 
> look in povray.text.scene-files for an include.
> mail me or post here for help/tips.
> 
> --
> //Spider
>         [ spi### [at] bahnhofse ]-[ http://www.bahnhof.se/~spider/ ]
> What I can do and what I could do, I just don't know anymore
>                 "Marian"
>         By: "Sisters Of Mercy"

1.) From what I can see from the first image you posted you have the makings
of a good recursive structure. It would be interesting to see if you could
expand on it to produce something in appearance to a coral branch matrix.
There are so many different type of coral I can't be more specific than that
but my first impression of the image was indeed coral more so than tree.

It's something to think about anyway and something I have not as yet seen
by any other artist.



2.)  I lack the background and ability for this next suggestion and
the recent flurry of activity in the tree production around here has
been amazing. One thing that has not yet been accomplished, and is in
my opinion, wide open territory for advancement in this category, is a
solution to making VERY large trees.

  The types I'm talking about are the type the Swiss Family Robinson's
built their tree house on, the 1200 year old live oaks seen in Great
Britain and the North American west coast regions, and the type you
typicaly see in storybooks that have cute little animals living inside
with a big front door at the base of the trunk. These types of trees
have massive limb structures that have little leaf coverage and the
smaller branches are quite few compared to the larger branches. Any
time I have tried to specify parameters, for a tree of this nature,
the current available include files don't seem able to cope with
branch sizes and branch splits on a scale large enough for realism.
They instead end up looking like a large round lump that has a whole
bunch of spiky things with leaves on them.

  This too is something to think about and is something I have not as
yet seen available in an easy to use include file. Obviously there is
a need for the smaller variety of trees as they are useful for gardens
and household landscaping but old growth forests like those seen in some
areas of Great Britain, Sherwood Forest for example, and other places
as well, require a much different tree type than those currently provided
for.



  Before you mention it Johannes I realize that this is one of the tree
types you hade in mind when you developed your Tree Designer program.
I'm also interested in an internal solution for the production of trees
of this type.
  By the way I have seen your program appearing on several shareware sites
so your exposure appears to be increasing in that regard. Any idea as to how
many copies of it have been distributed to date ? Just curious.



Regards to all,

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

From: Spider
Subject: Re: Script, idea/help.
Date: 18 Apr 1999 22:05:53
Message: <371A804E.1C70B405@bahnhof.se>
To be honest, I have no idea of how the coral branches you talk about look.
As for the bbig trees, I know how they look, but I have no idea as for how to
create one.

Buit I'll assure you, it'll be cooking in my mind, perhaps someday I'll get it..



Ken wrote:
> 
> Spider wrote:
> >
> > look in povray.text.scene-files for an include.
> > mail me or post here for help/tips.
> >
> > --
> > //Spider
> >         [ spi### [at] bahnhofse ]-[ http://www.bahnhof.se/~spider/ ]
> > What I can do and what I could do, I just don't know anymore
> >                 "Marian"
> >         By: "Sisters Of Mercy"
> 
> 1.) From what I can see from the first image you posted you have the makings
> of a good recursive structure. It would be interesting to see if you could
> expand on it to produce something in appearance to a coral branch matrix.
> There are so many different type of coral I can't be more specific than that
> but my first impression of the image was indeed coral more so than tree.
> 
> It's something to think about anyway and something I have not as yet seen
> by any other artist.
> 
> 2.)  I lack the background and ability for this next suggestion and
> the recent flurry of activity in the tree production around here has
> been amazing. One thing that has not yet been accomplished, and is in
> my opinion, wide open territory for advancement in this category, is a
> solution to making VERY large trees.
> 
>   The types I'm talking about are the type the Swiss Family Robinson's
> built their tree house on, the 1200 year old live oaks seen in Great
> Britain and the North American west coast regions, and the type you
> typicaly see in storybooks that have cute little animals living inside
> with a big front door at the base of the trunk. These types of trees
> have massive limb structures that have little leaf coverage and the
> smaller branches are quite few compared to the larger branches. Any
> time I have tried to specify parameters, for a tree of this nature,
> the current available include files don't seem able to cope with
> branch sizes and branch splits on a scale large enough for realism.
> They instead end up looking like a large round lump that has a whole
> bunch of spiky things with leaves on them.
> 
>   This too is something to think about and is something I have not as
> yet seen available in an easy to use include file. Obviously there is
> a need for the smaller variety of trees as they are useful for gardens
> and household landscaping but old growth forests like those seen in some
> areas of Great Britain, Sherwood Forest for example, and other places
> as well, require a much different tree type than those currently provided
> for.
> 
>   Before you mention it Johannes I realize that this is one of the tree
> types you hade in mind when you developed your Tree Designer program.
> I'm also interested in an internal solution for the production of trees
> of this type.
>   By the way I have seen your program appearing on several shareware sites
> so your exposure appears to be increasing in that regard. Any idea as to how
> many copies of it have been distributed to date ? Just curious.
> 
> Regards to all,
> 
> --
> Ken Tyler
> 
> mailto://tylereng@pacbell.net

-- 
//Spider
        [ spi### [at] bahnhofse ]-[ http://www.bahnhof.se/~spider/ ]
What I can do and what I could do, I just don't know anymore
                "Marian"
        By: "Sisters Of Mercy"


Post a reply to this message

Goto Latest 10 Messages Next 4 Messages >>>

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