POV-Ray : Newsgroups : povray.general : Gravity well. Need iso-pigment help? Server Time
7 Aug 2024 19:24:29 EDT (-0400)
  Gravity well. Need iso-pigment help? (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: Bill DeWitt
Subject: Gravity well. Need iso-pigment help?
Date: 30 Jul 2001 14:21:13
Message: <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...

    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)


Post a reply to this message

From: Ron Parker
Subject: Re: Gravity well. Need iso-pigment help?
Date: 30 Jul 2001 14:35:51
Message: <slrn9mba89.tcm.ron.parker@fwi.com>
On Mon, 30 Jul 2001 14:20:54 -0400, 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".

The limit is really 256; I wonder why your code thinks it's lower.

-- 
plane{-z,-3normal{crackle scale.2#local a=5;#while(a)warp{repeat x flip x}rotate
z*60#local a=a-1;#end translate-9*x}pigment{rgb 1}}light_source{-9red 1rotate 60
*z}light_source{-9rgb y rotate-z*60}light_source{9-z*18rgb z}text{ttf"arial.ttf"
"RP".01,0translate-<.6,.4,.02>pigment{bozo}}light_source{-z*3rgb-.2}//Ron Parker


Post a reply to this message

From: Bill DeWitt
Subject: Re: Gravity well. Need iso-pigment help?
Date: 30 Jul 2001 15:00:38
Message: <3b65aed6@news.povray.org>
"Ron Parker" <ron### [at] povrayorg> wrote in message
news:slr### [at] fwicom...
> On Mon, 30 Jul 2001 14:20:54 -0400, 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".
>
> The limit is really 256; I wonder why your code thinks it's lower.


    Because to make a stripe, you need four entries. Sorry, I used a count
variable and forgot to translate for that post. Here's the code:

#declare C = 0;
#declare GridTex3 =
 texture {
 pigment {
 gradient y
 color_map{
            #local   I = 0.00;
            #local   B = 0.01;
            #while ( I < 1.00 )
             [ I-B rgb < 0.0, 0.0, 0.4 >*2 ]
             [ I-B rgb 3 ]
             [ I+B rgb 3 ]
             [ I+B rgb < 0.0, 0.0, 0.4 >*2 ]
            #local B = (B*0.95);
            #declare C = C + 1;
            #local I = I + 0.0159;
            #debug concat("  I : ", str(I,2,4),
                          "  B : ", str(B,2,15),
                          "\n")
                   #end
         } /// end colormap
         } /// end pigment
         } /// end texture

#debug concat("  C : ", str(C,2,4),"\n")


Post a reply to this message

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

Goto Latest 10 Messages Next 3 Messages >>>

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