POV-Ray : Newsgroups : povray.newusers : Wrapping around objects (or knowing an object's shape) Server Time
29 Jul 2024 16:27:37 EDT (-0400)
  Wrapping around objects (or knowing an object's shape) (Message 1 to 9 of 9)  
From: Mueen Nawaz
Subject: Wrapping around objects (or knowing an object's shape)
Date: 6 Jun 2005 00:22:44
Message: <42a3cf94$1@news.povray.org>
Hi,

	Not a beginner to POV-Ray (first experience in 1995).

	Not sure I can call myself a beginner by experience, but I surely am a
beginner by virtue of ability. To confuse matters further, I've posted
in the advanced newsgroup...

	I'm sure these have simple answers, but my brain gave up.
	
	I'm working on making a cake in POV-Ray. For the "base" of the cake,
I'm using a simple superquadric ellipsoid (basically a cylinder with
slightly rounded edges). Now I want to put the icing. I just want some
material that sort of wraps around the top of the base, and extends a
little bit down the sides, but with quite a bit of variation in how far
it extends down.

	I couldn't think of any simple way without having to resort to
meshes/patches using external software (of which I know how to use
none). Any ideas?

	I'm guessing one possibility is to have a thin closed cylindrical shell
(using a CSG difference on two cylinders - one inside the other). Then
using some further CSG to get that variation I desired, and then placing
the shell open end down onto the base. Then fiddling a bit with the
normal so as not to make it look of uniform thickness all around.

	Hmm...That actually sounds like it may work (thought of it only while
writing this). Anyway, still curious to hear if anyone has
better/simpler ideas.

Thanks.

-- 
When an agnostic dies, does he go to the "great perhaps"?


                    /\  /\               /\  /
                   /  \/  \ u e e n     /  \/  a w a z
                       >>>>>>mue### [at] nawazorg<<<<<<
                                   anl


Post a reply to this message

From: Bob Hughes
Subject: Re: Wrapping around objects (or knowing an object's shape)
Date: 6 Jun 2005 04:40:50
Message: <42a40c12$1@news.povray.org>
"Mueen Nawaz" <m.n### [at] ieeeorg> wrote in message 
news:42a3cf94$1@news.povray.org...
> Not a beginner to POV-Ray (first experience in 1995).

Gee, that's just one year less than me. Give or take several months, maybe. 
Been such a long time.

> I'm working on making a cake in POV-Ray. For the "base" of the cake,
> I'm using a simple superquadric ellipsoid (basically a cylinder with
> slightly rounded edges). Now I want to put the icing.

You're CSG of carved cylinders would probably work okay if seen from a 
distance away.

You might want to try using a blob, cobbled together using #while loop and 
randomized positions and scales.

I'd type one up here as an example to explain better but I'm only stopping 
in real quick here. Hopefully you know of these things already anyway. 
Negative strength component parts could be useful, too. I'd use a cylinder 
component (sorry, I still call the blob pieces this name even though that 
changed long ago) for the main icing cover then create indentations using 
negative parts, and finally add dripping sides with positive strength 
spheres (scaled/rotated appropriately).

Bob Hughes


Post a reply to this message

From: Mueen Nawaz
Subject: Re: Wrapping around objects (or knowing an object's shape)
Date: 6 Jun 2005 20:53:14
Message: <42a4effa$1@news.povray.org>
Bob Hughes wrote:
>>Not a beginner to POV-Ray (first experience in 1995).
> 
> Gee, that's just one year less than me. Give or take several months, maybe. 
> Been such a long time.

	Well, I'll confess. I started with raytracing in 1994 with Alexander
Enzmann's Poly-Ray (who, as  you may know, was a contributor to POV-Ray
in those days). I was introduced to it through the disk that came with
Personal Computer World (UK - now defunct PC magazine). Had never heard
of raytracing, but the tutorial in the magazine produced awesome results
with little effort, and I was hooked.

	POV-Ray was mentioned, and I got it in '95. However, I was able to make
much better scenes much more quickly with Polyray, and so there wasn't
too much motivation to use POV-Ray. But then Polyray was no longer.

> You might want to try using a blob, cobbled together using #while loop and 
> randomized positions and scales.
> 
> I'd type one up here as an example to explain better but I'm only stopping 
> in real quick here. Hopefully you know of these things already anyway. 
> Negative strength component parts could be useful, too. I'd use a cylinder 
> component (sorry, I still call the blob pieces this name even though that 
> changed long ago) for the main icing cover then create indentations using 
> negative parts, and finally add dripping sides with positive strength 
> spheres (scaled/rotated appropriately).

	Hmm...Seems like it should work, and sort of obvious now that you
mention it. I don't have a good feel for blobs, which is perhaps why.
Will give it a try. Thanks.

-- 
When an agnostic dies, does he go to the "great perhaps"?


                    /\  /\               /\  /
                   /  \/  \ u e e n     /  \/  a w a z
                       >>>>>>mue### [at] nawazorg<<<<<<
                                   anl


Post a reply to this message

From: Bob Hughes
Subject: Re: Wrapping around objects (or knowing an object's shape)
Date: 6 Jun 2005 21:49:59
Message: <42a4fd47$1@news.povray.org>
"Mueen Nawaz" <m.n### [at] ieeeorg> wrote in message 
news:42a4effa$1@news.povray.org...
> Bob Hughes wrote:
>>>Not a beginner to POV-Ray (first experience in 1995).
>>
>> Gee, that's just one year less than me. Give or take several months, 
>> maybe.
>> Been such a long time.
>
> Well, I'll confess. I started with raytracing in 1994 with Alexander
> Enzmann's Poly-Ray

Wow. Just like me, or I you. Maybe was late 1993, I just don't recall 
anymore.

I didn't have a good computer until mid-'93 (DELL 486DX math coprocessor, 
was Tandy 1000 before) so all I ever did was use e-paint, simple CAD 
programs and basic (ala Basic) screen plotting. I roamed around AOL a while 
and somehow picked up on Polyray there. Main thing I remember about it was 
the "depth" output, for putting it into a random dot stereogram program.

I had learned a little about these concepts during the late '80's just from 
watching some Public Broadcasting Station stuff and reading science 
magazines, although I didn't really know anything about ray tracing itself. 
Happened across POV-Ray while I was finding more things about it. That led 
me to CompuServe because of the group of people involved in it there, 
leaving AOL for about a year, but I couldn't move around in CS fast enough 
even though I had upgraded the modem (2400 to 14400??). AOL was tried again 
and it was much quicker to get places than I was able to do in CS. Until as 
recently as last year I was still using AOL, even with Cable internet access 
since 2000 (had only TV antenna, then small satellite dish those last two 
years), although I had been in the process of leaving AOL quite a while.

Ooops. Turning this into a biography!

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'm thinking using all spheres might still be plausible, but at this point 
I'd be willing to change my suggestion to a height_field instead.  ;)

Bob Hughes


Post a reply to this message

From: Mueen Nawaz
Subject: Re: Wrapping around objects (or knowing an object's shape)
Date: 7 Jun 2005 00:34:52
Message: <42a523ec$1@news.povray.org>
Bob Hughes wrote:
> I didn't have a good computer until mid-'93 (DELL 486DX math coprocessor, 
> was Tandy 1000 before) so all I ever did was use e-paint, simple CAD 

	Hmm...Sounds familiar. I was with an 8088 XT until February 1994. At
which time I got a 486 DX2 66. I think one of the first uses I put it to
was Fractint. I actually had had version 7 which worked on an XT with
CGA graphics, and even then it was fun. But then with the newer Fractint
- heaven.

> even though I had upgraded the modem (2400 to 14400??). AOL was tried again 
> and it was much quicker to get places than I was able to do in CS. Until as 
> recently as last year I was still using AOL, even with Cable internet access 
> since 2000 (had only TV antenna, then small satellite dish those last two 
> years), although I had been in the process of leaving AOL quite a while.

	You're way ahead of me. I didn't get live Internet (other than email)
until 1998. I did, however, connect to a lot of local BBS's, which is
where I ultimately got POV-Ray.

> 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. I placed a
(huge) number of spheres randomly just around the icing, and let them do
their work.

	The result is actually quite fine for now. However, it took quite a lot
of spherical blobs to get it (using about 25000). Perhaps I could bring
that number down by using a different radius, etc. I'm beginning to
think I'll go back to my cylindrical shell idea (not sure I need a
shell, now that I think about it), and see what I can concoct there, and
compare (using a normal pattern, or a normal map).

> I'm thinking using all spheres might still be plausible, but at this point 
> 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?

	Well, here's my image using blobs:

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.

-- 
Beware of quantum ducks.       Quark!     Quark!


                    /\  /\               /\  /
                   /  \/  \ u e e n     /  \/  a w a z
                       >>>>>>mue### [at] nawazorg<<<<<<
                                   anl


Post a reply to this message

From: Mike Williams
Subject: Re: Wrapping around objects (or knowing an object's shape)
Date: 7 Jun 2005 02:49:19
Message: <MjxQHBAfNUpCFwYF@econym.demon.co.uk>
Wasn't it Mueen Nawaz who wrote:
>Hi,
>
>       Not a beginner to POV-Ray (first experience in 1995).
>
>       Not sure I can call myself a beginner by experience, but I surely am a
>beginner by virtue of ability. To confuse matters further, I've posted
>in the advanced newsgroup...
>
>       I'm sure these have simple answers, but my brain gave up.
>       
>       I'm working on making a cake in POV-Ray. For the "base" of the cake,
>I'm using a simple superquadric ellipsoid (basically a cylinder with
>slightly rounded edges). Now I want to put the icing. I just want some
>material that sort of wraps around the top of the base, and extends a
>little bit down the sides, but with quite a bit of variation in how far
>it extends down.

My approach would be to create an isosurface that had a similar shape to
the part of the object that I was trying to cover, and then add some
noise to it.

I've posted the resulting image in povray.binaries.images

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Bob Hughes
Subject: Re: Wrapping around objects (or knowing an object's shape)
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

From: Bob Hughes
Subject: Re: Wrapping around objects (or knowing an object's shape)
Date: 7 Jun 2005 03:04:50
Message: <42a54712$1@news.povray.org>
Well you sure made that look easy! Thanks Mike.

Bob


Post a reply to this message

From: James Buddenhagen
Subject: Re: Wrapping around objects (or knowing an object's shape)
Date: 8 Jun 2005 09:25:30
Message: <42a6f1ca$1@news.povray.org>
"Mike Williams" <nos### [at] econymdemoncouk> wrote in message
news:Mjx### [at] econymdemoncouk...
> Wasn't it Mueen Nawaz who wrote:
> >Hi,
> >
> >       Not a beginner to POV-Ray (first experience in 1995).
> >
> >       Not sure I can call myself a beginner by experience, but I surely am a
> >beginner by virtue of ability. To confuse matters further, I've posted
> >in the advanced newsgroup...
> >
> >       I'm sure these have simple answers, but my brain gave up.
> >
> >       I'm working on making a cake in POV-Ray. For the "base" of the cake,
> >I'm using a simple superquadric ellipsoid (basically a cylinder with
> >slightly rounded edges). Now I want to put the icing. I just want some
> >material that sort of wraps around the top of the base, and extends a
> >little bit down the sides, but with quite a bit of variation in how far
> >it extends down.
>
> My approach would be to create an isosurface that had a similar shape to
> the part of the object that I was trying to cover, and then add some
> noise to it.
>
> I've posted the resulting image in povray.binaries.images
>
> -- 
> Mike Williams
> Gentleman of Leisure

Thats a fine looking cake! I hope you'll post a recipe (source) over in
p.b.s-f or add something similar in your fine tutorial pages.
--
Jim Buddenhagen
http://home.earthlink.net/~jbuddenh/


Post a reply to this message

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