POV-Ray : Newsgroups : povray.advanced-users : Wiggly shape maker? Server Time
31 Oct 2024 08:18:30 EDT (-0400)
  Wiggly shape maker? (Message 1 to 4 of 4)  
From: sumdumguy
Subject: Wiggly shape maker?
Date: 25 Jun 2007 23:05:02
Message: <web.468082298f68e2a3e08693640@news.povray.org>
I first asked in newbie group but got no answer. Hopefully, someone here
might know. Not sure if it belongs in this group but I am really looking
for an answer.
-------------
I am looking to create an effect where I have a tube and there is algae
growing off of it. The rough shape is similar to this image:
http://www.fortunecity.com/greenfield/hawks/191/ChekJawa/chek3.jpg
That seems to be a real thing so no pov model is available :).
I am wondering whether there is a tool which generates such things. It is
not quite landscape or tree generator (needs to be semitransparent and no
branching and does not grow on a plane but on a tube, also needs to
"wiggle").


Post a reply to this message

From: sumdumguy
Subject: Re: Wiggly shape maker?
Date: 25 Jun 2007 23:40:01
Message: <web.46808a05c0506aede08693640@news.povray.org>
"sumdumguy" <nomail@nomail> wrote:
> I first asked in newbie group but got no answer. Hopefully, someone here
> might know. Not sure if it belongs in this group but I am really looking
> for an answer.
> -------------
> I am looking to create an effect where I have a tube and there is algae
> growing off of it. The rough shape is similar to this image:
> http://www.fortunecity.com/greenfield/hawks/191/ChekJawa/chek3.jpg
> That seems to be a real thing so no pov model is available :).
> I am wondering whether there is a tool which generates such things. It is
> not quite landscape or tree generator (needs to be semitransparent and no
> branching and does not grow on a plane but on a tube, also needs to
> "wiggle").

OK, they took down the image, and in any case it seems the animal is called
"tube anemone" not algae. If you search google images for:
"colorful tube anemone" Cerianthus
it's the only entry. Sorry, I cannot post images directly to the group.


Post a reply to this message

From: Tim Attwood
Subject: Re: Wiggly shape maker?
Date: 26 Jun 2007 18:11:50
Message: <46818f26$1@news.povray.org>
I don't think there is a pre-done package
for wiggly shapes. Here's a couple of macros
that might be of use in creating an anemone
script or macro. The first one gets a random point on
a surface, that could be used to place the tentacles
at the base. The other is a macro for collision
detection, this could be used to make sure the
tentacles don't overlap.

#include "rand.inc"
#macro RandOnSurface(Obj, rsd, thresh)
   #local mn = min_extent(Obj)-thresh;
   #local mx = max_extent(Obj)+thresh;
   #local dist = 1000000;
   #while (dist>thresh)
      #local flag = 0;
      #while (flag = 0)
         #local rfrom = VRand_In_Box(mn, mx, rsd);
         #local rdir = VRand_On_Sphere(rsd);
         #declare Norm = <0, 0, 0>;
         #local hit = trace(Obj, rfrom, rdir, Norm);
         #if (vlength(Norm) != 0)
            #local flag = 1;
         #end
      #end
      #local dist = vlength( hit - rfrom);
   #end
   #local result = hit;
   (result)
#end

#macro collision(A, B, rez)
   #local result = false;
   #if (((min_extent(A).x > max_extent(B).x ) |
         (min_extent(B).x > max_extent(A).x ) |
         (min_extent(A).y > max_extent(B).y ) |
         (min_extent(B).y > max_extent(A).y ) |
         (min_extent(A).z > max_extent(B).z ) |
         (min_extent(B).z > max_extent(A).z ))=false)
      #local AB = intersection{object{A} object{B}};
      #local Mn = min_extent(AB);
      #local Mx = max_extent(AB);
      #local S1 = seed(1);
      #local Pt = VRand_In_Box(Mn, Mx, S1);
      #local cnt = 0;
      #while ((result = false) & (cnt < rez))
         #local Pt = VRand_In_Box(Mn, Mx, S1);
         #if (inside(AB, Pt))
            #local result = true;
         #end
         #local cnt = cnt + 1;
      #end
   #end
   result
#end


Post a reply to this message

From: Tim Attwood
Subject: Re: Wiggly shape maker?
Date: 27 Jun 2007 02:31:44
Message: <46820450$1@news.povray.org>
I went ahead and made an anemone...
You can look at the code in p.b.s-f


Post a reply to this message

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