POV-Ray : Newsgroups : povray.general : Gravity well. Need iso-pigment help? Server Time
7 Aug 2024 21:24:44 EDT (-0400)
  Gravity well. Need iso-pigment help? (Message 4 to 13 of 13)  
<<< Previous 3 Messages Goto Initial 10 Messages
From: Simen Kvaal
Subject: Re: Gravity well. Need iso-pigment help?
Date: 30 Jul 2001 18:46:02
Message: <3b65e3aa$1@news.povray.org>
"Bill DeWitt" <bde### [at] cflrrcom> wrote in message
news:3b65a599@news.povray.org...
> I am trying to make a texture for my gravity well grid and I cannot seem
to
> get it to work. Problem 1) regular color_maps can only seem to take 64
> entries in their "Blendmap".
>
>     So I thought I would try to make an iso-surface or megapov pigment
using
> a similar function as my isosurface. This is where I think I will need
some
> help...
>

I think this is a useable method: (At least for one well...)

You have an analytic expression for the depth, which goes as 1/r. You want
equally spaced lines in, say, unit intervals, and you want the lines to have
an approximately (if not exact) even width. Clearly, the interval in the
color_map where the line is (say, white as apposed to blue) must approach
zero as the potential approaces zero.

Make a graph of 1/x and mark some [n, n+1] intervals. The arc-length of the
graph of f(x) is

    L = int ( sqrt(1+f'(x)^2), x1, x2 )

between x1 and x2. Now, f'(x) = -1/x^2 ==> f'(x)^2 = 1/x^4, and

     int ( sqrt(1 + x^-4) ) = sqrt( -1/3 * x^-3 + x ) =def= g(x)

(did _you_ take that on the spot? Neither did I... integrator.wolfram.com.)

Now you can make a custom pigment in megapow using the arc-length function
g(x). The height at which you want to calculate the arc-length is 1/x or
something. The arc-length is the same at every point at a given height, due
to the rotational symmetry of the potential. Thus, you bring 1/y (=x) into
the arc-length function: g(1/y). this gives (I might do some errors here, as
I am doing this in Outlook... :)

g(1/y) = sqrt ( -1/3 * (1/y)^-3 + 1/y ) = sqrt(-1/3 * y^3 + 1/y).

You have to make some modulo-function to wrap g around every time y passes
some value, but that shouldn't be too difficult ... I guess. And just make
your color_map as before...

Hope this is useful! I'd be surprised, really ... :}

Regards,
Simen Kvaal.


Post a reply to this message

From: Alberto
Subject: Re: Gravity well. Need iso-pigment help?
Date: 30 Jul 2001 20:10:34
Message: <3B65F6D0.B17B8839@usb.ve>
I agree with Simen Kvaal that the exact solution to the problem involves
the calculation of the arc of length
 
>      int ( sqrt(1 + x^-4) ).

But using mathematica I could verify that this integral is written in
terms of elliptic functions. (what can we do? life is not so ease).
Worse than that I think that the inverse of this function is what is
needed to solve the problem.

Here is another approach. Take the function if(sin(h(x)),0,1) which
gives 0 if sin(h(x)) < 0 and 1 if sin(h(x)) > 0. Playing with the
function h one can obtain an approximate solution to the pigment.

Below is an example

#version unofficial MegaPov 0.7;
camera{location <0, .5, -5> look_at -2*y angle 60}

light_source{<0, .5, -5>  rgb 1  shadowless}

isosurface{
  function{y + (x*x + z*z)^(-1/2)}
  contained_by{box -<2,3,0> <2,2,2>} 
  pigment{
    function{ if(sin(exp(1.5*(y+3))),0,1)}
    scale 1
    color_map{[0 rgb x][1 rgb y]}
  }
}

Regards, Alberto.


Post a reply to this message

From: Bill DeWitt
Subject: Re: Gravity well. Need iso-pigment help?
Date: 31 Jul 2001 00:13:00
Message: <3b66304c$1@news.povray.org>
"Simen Kvaal" <sim### [at] remove_mestudentmatnatuiono> wrote :
>
> Hope this is useful! I'd be surprised, really ... :}

    Wobbitywobbitywobbity... <golfball sized swellings show up and shrink in
random spots on my head, smoke comes out of my ears, grinding sounds and the
noise of bricks thumping into mud emanates from the back of my head>

    I don't get it... I will have to stew on this for a while.


Post a reply to this message

From: Bill DeWitt
Subject: Re: Gravity well. Need iso-pigment help?
Date: 31 Jul 2001 00:19:31
Message: <3b6631d3$1@news.povray.org>
"Alberto" <jac### [at] usbve> wrote :
>
> Below is an example
>
> #version unofficial MegaPov 0.7;
> camera{location <0, .5, -5> look_at -2*y angle 60}
>
> light_source{<0, .5, -5>  rgb 1  shadowless}
>
> isosurface{
>   function{y + (x*x + z*z)^(-1/2)}
>   contained_by{box -<2,3,0> <2,2,2>}
>   pigment{
>     function{ if(sin(exp(1.5*(y+3))),0,1)}
>     scale 1
>     color_map{[0 rgb x][1 rgb y]}
>   }
> }

    This works (but you knew that) now if I can just figure it out enough to
adapt it.... thanks again.


Post a reply to this message

From: Bill DeWitt
Subject: Re: Gravity well. Need iso-pigment help?
Date: 31 Jul 2001 08:59:31
Message: <3b66abb3$1@news.povray.org>
"Bill DeWitt" <bde### [at] cflrrcom> wrote :
>
>     This works

    Actually it only sort of works. I'm playing with the idea, but I may end
up just making the grid thin enough to look good on the flats and ignoring
the steeps.

    But a grid texture that adjusted itself to the contours of an isosurface
(or any surface) would be a good tool for visualizations.


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Gravity well. Need iso-pigment help?
Date: 31 Jul 2001 21:17:36
Message: <3B67578D.E73854D1@hotmail.com>
Bill DeWitt wrote:
> 
> But a grid texture that adjusted itself to the contours of an 
> isosurface (or any surface) would be a good tool for visualizations.

Do you mean something similar to the
square grid in the image i just posted 
to povray.binaries.images ?

news://news.povray.org/3B6756B7.A68344EA%40hotmail.com

(I coloured the texture for this iso-
surface with a pigment function.)


-- 
Best regards,

Tor Olav

mailto:tor### [at] hotmailcom
http://hjem.sol.no/t-o-k
http://www.crosswinds.net/~tok


Post a reply to this message

From: Bill DeWitt
Subject: Re: Gravity well. Need iso-pigment help?
Date: 31 Jul 2001 23:06:13
Message: <3b677225$1@news.povray.org>
"Tor Olav Kristensen" <tor### [at] hotmailcom> wrote :
>
> Do you mean something similar to the
> square grid in the image i just posted
> to povray.binaries.images ?

    Well, no. Grid lines going x and z don't have the problem, it is y that
gives the problem.


Post a reply to this message

From: Michael Andrews
Subject: Re: Gravity well. Need iso-pigment help?
Date: 1 Aug 2001 11:51:34
Message: <3B6826F0.E7096D91@reading.ac.uk>
Hi Bill,

Here's my try at the function; not too complex, fairly easy to adapt for
different well widths and needed frequency.

Bye for now,
	Mike Andrews.


Bill DeWitt wrote:
> 
> I am trying to make a texture for my gravity well grid and I cannot seem to
> get it to work. Problem 1) regular color_maps can only seem to take 64
> entries in their "Blendmap".
> 
>     So I thought I would try to make an iso-surface or megapov pigment using
> a similar function as my isosurface. This is where I think I will need some
> help...
> 
>     What I am trying to do is make the grid lines, that used to be a simple
> gradient with a high frequency. But as the slope of the isosurface reaches
> the horizontal, the apparent width of the grid line becomes much wider. So I
> have been trying to make my pigment get narrower as it rises. In a
> color_map, I used a loop and a declining variable to describe the width of
> the line but, as I said, only 64 entries and I need many more.
> 
>     So is there a good way to make a quasi-gradient in iso-surface
> function-to-pigment where I can control the decrease in the section of
> pigment that makes the grid line? (see pbi for example)

// start of code

#version unofficial Megapov 0.7;

global_settings { 
  max_trace_level 50
  assumed_gamma 1
  ambient_light 1
}

camera {
  location <-3,15,-10>
  direction 1.2*z  
  right     x*image_width/image_height
  look_at   0
}

background { color rgb 0.3 }

light_source { <10,30,-5> color rgb 1 }

#declare A = 16;  // square of width at y = -1
#declare F = 5;   // contour frequency per y
#declare C = 0.5; // coverage of surface at y = -inf

#declare fnGrav = function { y + A/max(0.1,sqr(x)+sqr(z)) }

#declare pigGrav = pigment { 
  function { 
    if(abs(F*y)-floor(abs(F*y))-C/sqrt(1+F*A*0.25/abs(y*y)), 1, 0) 
  } 
}

isosurface {
  function { fnGrav(x, y, z) }
  eval
  contained_by { box { -<10,5,10>,<10,0,10> } }
  pigment { pigGrav colour_map {[0 rgb 0][1 rgb 1]} }
}

// end of code


Post a reply to this message

From: Bill DeWitt
Subject: Re: Gravity well. Need iso-pigment help?
Date: 1 Aug 2001 13:47:45
Message: <3b6840c1@news.povray.org>
"Michael Andrews" <M.C### [at] readingacuk> wrote in message
news:3B6826F0.E7096D91@reading.ac.uk...
> Hi Bill,
>
> Here's my try at the function; not too complex, fairly easy to adapt for
> different well widths and needed frequency.


    That looks great, Thanks! Do you mind if I adapt it and repackage it for
distribution on this board as long as I retain your name in the file for
credit?


Post a reply to this message

From: Michael Andrews
Subject: Re: Gravity well. Need iso-pigment help?
Date: 2 Aug 2001 07:12:19
Message: <3B693701.AF756A7F@reading.ac.uk>
Hi Bill,

If it works for you, feel free to use it as you like.

Bye for now,
	Mike Andrews.


Bill DeWitt wrote:
> 
> "Michael Andrews" <M.C### [at] readingacuk> wrote in message
> news:3B6826F0.E7096D91@reading.ac.uk...
> > Hi Bill,
> >
> > Here's my try at the function; not too complex, fairly easy to adapt for
> > different well widths and needed frequency.
> 
>     That looks great, Thanks! Do you mind if I adapt it and repackage it for
> distribution on this board as long as I retain your name in the file for
> credit?


Post a reply to this message

<<< Previous 3 Messages Goto Initial 10 Messages

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