POV-Ray : Newsgroups : povray.binaries.images : Who pulled the plug? - bathtub.jpeg (1/1) Server Time
19 Aug 2024 12:17:49 EDT (-0400)
  Who pulled the plug? - bathtub.jpeg (1/1) (Message 11 to 20 of 27)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 7 Messages >>>
From: Chris Huff
Subject: Re: Who pulled the plug? - bathtub.jpeg (1/1)
Date: 15 Dec 2000 21:41:27
Message: <chrishuff-11EA66.21422815122000@news.povray.org>
In article <3a3a9ceb@news.povray.org>, "sacrofts" 
<sac### [at] tinyonlinecouk> wrote:

> Yes, I wish we could have an archive of all these wonderful functions 
> people are coming across
> I for one, just cannot come up with this sort of thing

I have been building a list of isosurface functions I think are 
useful...maybe I will include this one in it.

-- 
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: Chris Huff
Subject: Re: Who pulled the plug? - bathtub.jpeg (1/1)
Date: 15 Dec 2000 21:42:50
Message: <chrishuff-08CD86.21435115122000@news.povray.org>
In article <3a3a0e23@news.povray.org>, "Lance Birch" <-> wrote:

> Ooo... very nice :)  I'd like to see that made in to a stereogram :))

Hmm...any particular reason this would make a better stereogram than any 
other scenes? Well, maybe if the view was directly above a vortex...

-- 
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: Chris Huff
Subject: Re: Who pulled the plug? - bathtub.jpeg (1/1)
Date: 15 Dec 2000 22:02:46
Message: <chrishuff-6D8475.22034615122000@news.povray.org>
In article <MPG.14a492244e6b256098985c@news.povray.org>, 
jam### [at] dh70qdu-netcom (Jamie Davison) wrote:

> I looked at the source, and whimpered...
> 
> Too much mathematics <shudder>

It's not that hard...it's a pretty simple function, made of even simpler 
pieces.

The full equation is:
1/(sqr(x)+sqr(z)+0.3) + sin(atan2(x,z)*7 + y*10)*0.025 = 0

The 1/(sqr(x)+sqr(z)+0.3) part is what gives it it's shape...it is based 
on 1/R where R is the distance from the y axis. The equation for R is 
sqrt(sqr(x) + sqr(z)), so that is just 1/(sqr(R)+0.3). The "+ 0.3" part 
keeps it from going to 1/0 at the y axis, and limits the depth of the 
vortex (Since the square of distance from the axis can't be negative, it 
can't go further than 1/0.3. I just got this value by trial and error.). 
You can graph the function 1/(sqr(x)+0.3) in any graphing program to get 
a cross-section of the basic vortex.

The second half adds the ripples:
sin(atan2(x,z)*7 + y*10)*0.025
The value of atan2(x,z) is simply the angle around the y axis measured 
in radians, similar to the "radial" pattern. I multiplied that by 7 to 
get more ripples, giving it a higher frequency, and then added an amount 
depending on height to make it spiral in as the sides of the vortex got 
steeper (basically rotating the density field by a height-dependant 
amount. Since the height changes more rapidly in the "walls" of the 
vortex, it will spiral in tighter.).
I took the sin() of this value to get the waves and added the result to 
the basic vortex shape...the sin() function produces a nice, smooth 
periodic waveform which makes it useful for this sort of thing. The 
*0.025 part scales the size of the ripples down, so they barely make an 
impression on the surface.

So most of it was just piecing together simple little expressions...

-- 
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: Lance Birch
Subject: Re: Who pulled the plug? - bathtub.jpeg (1/1)
Date: 15 Dec 2000 22:07:32
Message: <3a3adc74@news.povray.org>
Chris Huff wrote:
> In article <3a3a0e23@news.povray.org>, "Lance Birch" <-> wrote:
>
> > Ooo... very nice :)  I'd like to see that made in to a stereogram :))
>
> Hmm...any particular reason this would make a better stereogram than any
> other scenes? Well, maybe if the view was directly above a vortex...

I just think it would look really interesting :)

To be able to see the vortex in 3D would be cool I think :)

Lance.

http://come.to/the.zone


Post a reply to this message

From: Ken
Subject: Re: Who pulled the plug? - bathtub.jpeg (1/1)
Date: 16 Dec 2000 00:55:12
Message: <3A3B04B3.850794A2@pacbell.net>
Chris Huff wrote:

> The full equation is:

My brain just fried....

-- 
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Jamie Davison
Subject: Re: Who pulled the plug? - bathtub.jpeg (1/1)
Date: 16 Dec 2000 08:22:37
Message: <MPG.14a57ca52986461b98985d@news.povray.org>
On Fri, 15 Dec 2000 22:03:46 -0500, Chris Huff wrote...
> > I looked at the source, and whimpered...
> > 
> > Too much mathematics <shudder>
> 
> It's not that hard...it's a pretty simple function, made of even simpler 
> pieces.


<foetal position>
<Whimper>
Make the bad man go away mommy...
<shake>


Post a reply to this message

From: Chris Huff
Subject: Re: Who pulled the plug? - bathtub.jpeg (1/1)
Date: 16 Dec 2000 09:49:57
Message: <chrishuff-6100FD.09505816122000@news.povray.org>
In article <3A3B04B3.850794A2@pacbell.net>, lin### [at] povrayorg 
wrote:

> > The full equation is:
> My brain just fried....

You really shouldn't rely on those Pentiums so much, especially for 
things with division... ;-)

-- 
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: Who pulled the plug? - bathtub.jpeg (1/1)
Date: 16 Dec 2000 10:09:34
Message: <slrn93mrci.sg9.steve@zero-pps.localdomain>
On Fri, 15 Dec 2000 22:03:46 -0500, Chris Huff wrote:

>It's not that hard...it's a pretty simple function, made of even simpler 
>pieces.

Take no notice of him, he always says that.

>The full equation is:
>1/(sqr(x)+sqr(z)+0.3) + sin(atan2(x,z)*7 + y*10)*0.025 = 0

I rest my case.

-- 
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:19pm  up 66 days, 15:44,  4 users,  load average: 0.94, 0.33, 0.10


Post a reply to this message

From: Anton Sherwood
Subject: Re: Who pulled the plug? - bathtub.jpeg (1/1)
Date: 17 Dec 2000 01:42:33
Message: <3A3C623F.692D2107@pobox.com>
Chris Huff wrote:
> function {
>     1/(sqr(x)+sqr(z)+0.3) + sin(atan2(x,z)*7 + y*10)*0.025
> }

Ingenious.  I wonder how close to reality it is.


-- 
Anton Sherwood  --  br0### [at] p0b0xcom  --  http://ogre.nu/


Post a reply to this message

From: Christoph Hormann
Subject: Re: Who pulled the plug? - bathtub.jpeg (1/1)
Date: 17 Dec 2000 03:49:37
Message: <3A3C7E22.B67C37A0@gmx.de>
Anton Sherwood wrote:
> 
> >     1/(sqr(x)+sqr(z)+0.3) + sin(atan2(x,z)*7 + y*10)*0.025
> > }
> 
> Ingenious.  I wonder how close to reality it is.
> 

The 1/r function is probably quite near to reality, although i'm not
totally sure and it's usually rounded at the bottom.  The 'atan2' part is
maybe not that realistic, because such flows use to contain a lot of
turbulence leading to a more irregular pattern.  

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 7 Messages >>>

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