POV-Ray : Newsgroups : povray.newusers : Wrapping around objects (or knowing an object's shape) : Re: Wrapping around objects (or knowing an object's shape) Server Time
29 Jul 2024 18:23:28 EDT (-0400)
  Re: Wrapping around objects (or knowing an object's shape)  
From: Bob Hughes
Date: 7 Jun 2005 03:02:52
Message: <42a5469c$1@news.povray.org>
"Mueen Nawaz" <m.n### [at] ieeeorg> wrote in message 
news:42a523ec$1@news.povray.org...
> Bob Hughes wrote:
>
>> I gave the blob idea a try to check on it myself and if you have, too, 
>> then
>> you might be having trouble using cylinder components in the way I 
>> imagined.
>
> I thought you were suggesting one cylinder component, and then many
> spherical components for subtracting. Which is what I did.

Yeah, sorta thinking as I typed but I meant both positive and negative 
strength spheres, not realizing the chaos that could be in a single blob.

>> I'd be willing to change my suggestion to a height_field instead.  ;)
>
> Don't you mean a bump map? How would I use a height field?

Nope, was thinking a HF could be good for the top to get the true 3D 
appearance. For example:

height_field {
 function 300,300 {
  pattern {
   bumps turbulence 0.25 scale 0.1
  }
 }
 translate -0.5 scale 2
 clipped_by { // lacks thickness, so intersection with cylinder might be 
best.
  sphere {0,1}
 }
 pigment {rgb 1}
 scale <1,0.05,1>
}

Yet that isn't exactly usable. Problem is that it isn't directly possible 
for sides, so perhaps an isosurface would have been a better suggestion. 
Something I don't have an example of but there might be something out there 
in the groups, maybe even in the sample scene files that I'm not 
remembering.

> http://www.nawaz.org/media/povray/newsgroup/cake.png
>
> I did the subtraction only on the sides of the icing, not on the top.
> Didn't expect the top to be so well rounded (actually wanted it to be
> flat), but it doesn't look too bad. If I keep this, I'll just compress
> it vertically.

Lots of icing, yum. And lots of spheres, too. ha ha

I just had to give it a try myself earlier, using only one blob, and it 
wasn't entirely successful. Textures get mixed in uncontrollable ways, i.e. 
surface proximity messed with the thin icing. Render this if you want to and 
you'll see what I mean:

// example cake with icing approximately 1 unit-sized
blob {
 cylinder {-y,y,1,1 scale <1.025,0.01,1.025> translate <0,0.1,0>
 //sphere {0,1,1 scale <1.025,0.05,1.025> translate <0,0.1,0>
 pigment {rgbf <0.95,0.95,0.95,0.05>}
 normal {wrinkles 0.25 scale 0.1}
 finish {ambient 0.5 diffuse 0.5 specular 0.25 roughness 0.075}
 }
 cylinder {-y,y,1,1 scale <1,0.2,1> translate <0,-0.25,0>
 pigment {rgb <0.4,0.15,0.05>}
 normal {granite 0.5 scale 0.1}
 finish {ambient 0.05 diffuse 0.5 specular 0.125 roughness 0.075}
 }
 #local I=1;
 #local Sx=seed(4321);
 #local Sy=seed(1234);
 #local Sz=seed(2413);
 #while (I>0)
 #local Rx=rand(Sx);
 #local Ry=rand(Sy);
 #local Rz=rand(Sz);
 sphere {0,1,1 scale <0.1+Rx/14,0.2+Ry/10,0.15+Rz/25>/4 translate 
<Rx/10,0.1-Ry/24,-0.75> rotate (-10+Rx*20)*z rotate (360-Rx*2)*I*y
 pigment {rgbf <0.95,0.95,0.95,0.025>}
 finish {ambient 0.5 diffuse 0.5 specular 0.25 roughness 0.075}
 }
 sphere {0,1,1 scale <0.125+Rx/12,0.25+Ry/8,0.1+Rz/25>/3 translate 
<Rx/15,0.05-Ry/24,-0.75> rotate (-10+Ry*20)*z rotate (360-Ry*2)*I*y
 pigment {rgbf <0.95,0.95,0.95,0.025>}
 finish {ambient 0.5 diffuse 0.5 specular 0.25 roughness 0.075}
 }
 sphere {0,1,1 scale <0.15+Rx/10,0.3+Ry/6,0.05+Rz/25>/2 translate 
<Rx/20,-0.025-Ry/24,-0.75> rotate (-10+Rz*20)*z rotate (360-Rz*2)*I*y
 pigment {rgbf <0.95,0.95,0.95,0.025>}
 finish {ambient 0.5 diffuse 0.5 specular 0.25 roughness 0.075}
 }
 #local I=I-0.008;
 #end
 threshold 0.2
 hierarchy on
 sturm off
 //rotate <-30,0,0>
}


Post a reply to this message

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