POV-Ray : Newsgroups : povray.unofficial.patches : Vortex Server Time
2 Sep 2024 04:17:05 EDT (-0400)
  Vortex (Message 1 to 5 of 5)  
From: Halbert
Subject: Vortex
Date: 15 Jul 2000 12:25:32
Message: <3970907c@news.povray.org>
Now that I have my previous problem worked out. I thought of something I'd
like to try: making an isosurface that would feature a vortex; the kind you
see when you pull the stopper out of the tub. This seems like the sort of
thing for which an isosurface would be ideally suited. I know there are
functions that can form the funnel shape and the spiraling edges, I'm just
not sure how to get them together to get the effect I'm looking for. I know
one of you guys with the giant brains ( Chris, Warp)  probably has an idea
how this might be done.:)


Post a reply to this message

From: Chris Huff
Subject: Re: Vortex
Date: 15 Jul 2000 16:08:16
Message: <chrishuff-0E2F41.15084215072000@news.povray.org>
In article <3970907c@news.povray.org>, "Halbert" <hha### [at] capitalnet> 
wrote:

> Now that I have my previous problem worked out. I thought of 
> something I'd like to try: making an isosurface that would feature a 
> vortex; the kind you see when you pull the stopper out of the tub. 
> This seems like the sort of thing for which an isosurface would be 
> ideally suited. I know there are functions that can form the funnel 
> shape and the spiraling edges, I'm just not sure how to get them 
> together to get the effect I'm looking for. I know one of you guys 
> with the giant brains ( Chris, Warp)  probably has an idea how this 
> might be done.:)

I'm not sure I qualify as having a "giant brain", but this is quite 
simple:
Start with a simple plane: function {y}

Add a function to it which is higher as it is nearer the y axis. There 
are many functions you can use for this, most based on the distance from 
the axis, calculated by sqrt(sqr(x)+sqr(z)).
function {y+(1/(sqr(x)+sqr(z)+0.3))}
The value "0.3" controls the depth of the vortex. If it is 1, the vortex 
will have a depth of 1. If 0, the vortex will go down to infinity.

Next, add some radial waves. This can be done by adding the sine of the 
angle around the y axis, calculated by atan2. The angle is multiplied by 
a certain amount to get multiple waves, and the result of sin(which 
varies from -1 to +1) is multiplied by a "wave amplitude" value:
function {
    y+(1/(sqr(x)+sqr(z)+0.3))
    +sin(atan2(x,z)*7)*0.1
}

Now you need to get the waves to spiral toward the center. I did this by 
adding an amount to the angle depending on the altitude, though you 
could probably also do it based on the distance from the center. Since 
the altitude changes more rapidly toward the center, the waves will 
spiral in faster:
function {
    y+(1/(sqr(x)+sqr(z)+0.3))
    +sin(atan2(x,z)*7 + y*10)*0.025
}
You can either add or subtract the "y*10", depending on which side of 
the equator you live on. :-)
Here is the complete isosurface:
#declare Vortex =
function {
    y+(1/(sqr(x)+sqr(z)+0.3))
    +sin(atan2(x,z)*7 + y*10)*0.025
}
isosurface {
    function {Vortex(x,y,z)}
    threshold 0
    eval
    max_gradient 4
    contained_by {box {<-5,-5,-5>, < 5, 1, 5>}}
    pigment {color rgb < 0.5, 0.85, 1>}
}

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Ken
Subject: Re: Vortex
Date: 15 Jul 2000 22:37:57
Message: <39711EB2.3DA5C31A@pacbell.net>
Chris Huff wrote:

> I'm not sure I qualify as having a "giant brain",...

Pssst... I think he was talking about a different Chris... j/k

-- 
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: Warp
Subject: Re: Vortex
Date: 17 Jul 2000 10:21:45
Message: <39731679@news.povray.org>
I have another solution, but it has speed and accuracy problems. Perhaps
interesting only for curiosity:

#version Unofficial MegaPov 0.5;

camera { location <-1,4,-5> look_at -y angle 35 }
light_source { <100,200,-50>, 1 }

#declare Spiral =
  function
  { pigment
    { spiral1 2 color_map { [0 rgb 0][1 rgb 1] }
      sine_wave
      rotate x*90 scale <.4,100,.4>
    }
  }

isosurface
{ function { 1/(sqrt(sqr(x)+sqr(z))+.01)+y+Spiral(x,y,z)*.05 }
  contained_by { box { <-2,-5,-2><2,1,2> } }
  max_gradient 100
  accuracy .01

  pigment { rgb <0,.5,1> } finish { specular .5 }
}


-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Halbert
Subject: Re: Vortex
Date: 17 Jul 2000 20:24:02
Message: <3973a3a2@news.povray.org>
Thank you. Your surface works perfectly. I hope to have an interesting image
to post soon!
HH


Post a reply to this message

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