POV-Ray : Newsgroups : povray.newusers : Blobs and loops Server Time
13 Nov 2024 07:24:21 EST (-0500)
  Blobs and loops (Message 1 to 7 of 7)  
From: Mick Hazelgrove
Subject: Blobs and loops
Date: 1 Jan 2001 07:22:22
Message: <3a50767e@news.povray.org>
Take the following fragment of code

$ XPos = 0;
$ ZPos =0;

#while(ZPos<100)
     #while(XPos<100)
            blob {
                     threshold .65
                            sphere{<XPos,0,ZPos>, 1, 1
pigment{rgb<.25,1,.25>}
                                        translate vturbulence (1.5, 3,
3,<XPos,0,ZPos>/33)
                                        translate x*-50
                                         }
                      }
            #declare XPos = XPos + 1;
             #end
  #declare XPos = 0;
  #declare ZPos = ZPos+1;
#end

How can I get all the blobs to bond together? I've tried putting the loop in
the blob statement but it seems to make no difference. I'm stumped, please
help

Mick


Post a reply to this message

From: Chris Huff
Subject: Re: Blobs and loops
Date: 1 Jan 2001 08:23:27
Message: <chrishuff-AA9834.08245301012001@news.povray.org>
In article <3a50767e@news.povray.org>, "Mick Hazelgrove" 
<mic### [at] mhazelgrovefsnetcouk> wrote:

> How can I get all the blobs to bond together?

Your loops are making many separate 1-component blobs. You need to put 
the entire looping structure that generates the components inside the 
blob{} block.


> I've tried putting the loop in the blob statement but it seems to 
> make no difference. I'm stumped, please help

Hmm...maybe your threshold and components are making it look like they 
aren't blobbing together...do you get a bunch of intersecting spheres, 
or are they completely disconnected?

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Steve
Subject: Re: Blobs and loops
Date: 1 Jan 2001 08:51:14
Message: <slrn9512ov.d1m.steve@zero-pps.localdomain>
On Mon, 1 Jan 2001 12:28:47 -0000, Mick Hazelgrove wrote:

>How can I get all the blobs to bond together? I've tried putting the loop in
>the blob statement but it seems to make no difference. I'm stumped, please
>help

Here's the code for a blob that has a while loop in it.
I hope it makes some sence to you and explains what you 
need to know to solve your problem. 

 #local DogEar = 
                 blob{
                      #local EarRot =0;
                      threshold 0.1
                        #while(EarRot <46)
                          sphere{<0,0.,0>, 0.125, 0.5  translate y*0.75 rotate
z*-EarRot}
                          #local EarRot = EarRot+2;
                        #end
                      sphere{<0,0.,0>, 0.15, 0.75  translate y*0.75}
                      texture{finish{ToyFinish}
                              pigment{TreeTrunckColour}
                             }

                      scale <1,1,0.45> 
                      rotate z*-110
                      scale <2.5,2.5,2.75>
                     }


-- 
Cheers
Steve              email mailto:ste### [at] zeroppsuklinuxnet

%HAV-A-NICEDAY Error not enough coffee  0 pps. 

web http://www.zeropps.uklinux.net/

or  http://start.at/zero-pps

  1:43pm  up 14 days,  1:04,  3 users,  load average: 1.19, 1.05, 1.01


Post a reply to this message

From: David Wilkinson
Subject: Re: Blobs and loops
Date: 1 Jan 2001 09:12:46
Message: <be215t8tkrf8h4jfoto944ii0ge8pjtjaa@4ax.com>
On Mon, 1 Jan 2001 12:28:47 -0000, "Mick Hazelgrove"
<mic### [at] mhazelgrovefsnetcouk> wrote:
>
>How can I get all the blobs to bond together? I've tried putting the loop in
>the blob statement but it seems to make no difference. I'm stumped, please
>help
>
Hi Mick,
Happy New year!

As Chris says, you are creating a lot of seperate blobs.  What you have to do is
have a single blob and have the loop within the blob.  I did this when I was
trying to create smoke for one of my locos.

This seems to work OK;
$ XPos = 0;
$ ZPos =0;

blob { 
            threshold .65
              #while(ZPos<100)
              #while(XPos<100)
                sphere{ <XPos,0,ZPos>, 1, 1
                        pigment{rgb<.25,1,.25>}
                        translate vturbulence (1.5, 3,3,<XPos,0,ZPos>/33)
                        translate x*-50
                }        
                    #declare XPos = XPos + 1;
                    #end 
                 #declare XPos = 0;
                 #declare ZPos = ZPos+1;
                #end                               
}

David
----------------------
dav### [at] hamiltonitecom
http://hamiltonite.com/


Post a reply to this message

From: Mick Hazelgrove
Subject: Re: Blobs and loops
Date: 1 Jan 2001 10:22:19
Message: <3a50a0ab@news.povray.org>
Thanks All


Mick


Post a reply to this message

From: Mick Hazelgrove
Subject: Re: Blobs and loops
Date: 1 Jan 2001 10:24:45
Message: <3a50a13d@news.povray.org>
That's it

The threshold statement needed to be outside the while loop!

Thanks again

Mick


Post a reply to this message

From: Warp
Subject: Re: Blobs and loops
Date: 1 Jan 2001 10:39:51
Message: <3a50a4c7@news.povray.org>
You are creating 10000 blobs with one component each instead of one
blob with 10000 components. The difference is quite clear.

  See http://iki.fi/warp/PovVFAQ/whileloops.html for more details.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;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.