POV-Ray : Newsgroups : povray.beta-test : isosurface MegaPov conversion to POV3.5 Server Time
31 Jul 2024 06:16:37 EDT (-0400)
  isosurface MegaPov conversion to POV3.5 (Message 1 to 5 of 5)  
From: smellenbergh
Subject: isosurface MegaPov conversion to POV3.5
Date: 9 Sep 2001 16:43:31
Message: <1ezhnxz.1xl4pg916b2xyyN%smellenbergh@skynet.be>
Here are some hints to convert syntax of MegaPov isosurface to 3.5 

* braces {} are required with functions
  "function x+y"
should be
  "function {x+y}"


* parameters of a declared function must be specified when called
  #declare FUNC = function {x+y+z}
  isosurface { function {FUNC} }
should be
  isosurface { function {FUNC(x,y,z)} }


* using internal functions (See 7.7 functions.inc)
  all internal functions are included in the functions.inc and start
with
"f_xxx". Parameters are set between ( ) braces and begin with the x,y,z
parameters)
   So, MegaPov's "sphere",<0.8> 
becomes 
  #include "functions.inc"
  f_sphere(x,y,z,0.8)
or, when declaring the function directly, without using the include
file:
  #declare MySphere = function { internal(61) }
  isosurface{ function{ MySphere(x,y,z,0.8) } }


* noise3d
  in 3.5 noise3d is treated as an internal function: use the
function.inc and
  f_noise3d(x*4,y*4,z*4)/5
Note that the noise uses pov's noise generator set in the global
settings:
global_settings{
  noise_generator 1 //old 3.1g plateaud noise
  noise_generator 2 //MegaPov 0.5 noise
  noise_generator 3 //New 3.5 perlin noise
}
...or use
  f_noise_generator(x,y,z, P0)
    * P0 : Noise generator number

*The func_ names have been renamed
  func_0  >  f_ellipsoid
  func_1  >  f_blob
  func_2  >  f_flange_cover
  func_2b  >  f_blob2
  func_3  >  f_cross_ellipsoids
  func_4  >  f_isect_ellipsoids
  func_5  >  f_spikes
  func_9  >  f_poly4
  func_10  >  f_spikes_2d
  func_11  >  f_quantum
  func_12  >  f_helical_torus
  func_13  >  f_comma
  func_16  >  f_polytubes
And the duplicate functions have been removed
  helix1 / func_6  >  f_helix1
  helix2 / func_7  >  f_helix2
  spiral / func_8  >  f_spiral
  mesh1 / func_14  >  f_mesh1



* using function { pigments } in isosurfaces
  the pigment must be declared. When calling it, the dot notation must
be used: FUNC(x,y,z).x
This allows to use the channels of the color vector in a controlled way
Allowed are:
  .x .u .red, .y .v .green, .z .t .blue, .filter, .transmit for the
separate channels
  .gray or .grey for the gray value of the color vector
  .hf for the height_field value of the color vector (this was the
method used in MegaPov)
  #declare Granny = function{
    pigment{
      granite scale 3
      color_map { [0 rgb 0] [1 rgb 1] }
    }
  }
  isosurface{function{f_sphere(x,y,z,1)+Granny(x,y,z).hf*0.2}}


* sign is no longer used in 3.5 isosurface
to switch inside/outside, turn the whole function negative:
  #declare Landscape = function { f_ridged_mf(x,y,z,1,2,10,1.1,2) }
  isosurface{function{ Landscape(x,0,z)-y }
becomes
  isosurface{function{ -(Landscape(x,0,z)-y) }


* sqr and cub no longer supported
  use ^2 and ^3 ,or pow(A,2) and pow(A,3)


* sqrt x^y and ln are used in the mathematical form in 3.5
  Isosurface     MegaPov internal   3.5 internal
  ----------     ---------------    ------------
  sqrt(x)     =  sqrt(abs(x))       =sqrt(x)
  x^y         =  abs(x)^y           =x^y
  ln(x)       =  ln(abs(x))         =ln(x)
So, these MegaPov functions might need to be written as they have been
used internally in MegaPov to get the same results in 3.5


* if(A,B,C)
  has been replaced by select (A,C,B)
MegaPov
  isosurface {function {if(-x, abs(x)+abs(y)-0.5, sqrt(z^2+y^2)-0.5)}
becomes in 3.5
  isosurface{function{select(-x, sqrt(z^2+y^2)-0.5, abs(x)+abs(y)-0.5)}


* method 1 and method 2
  keywords no longer used in 3.5: a method 2-ish method is standard


* eval
  eval becomes evaluate and *requires* 3 parameters without the vector
braces: evaluate A,B,0.99 which is the same as MegaPov's eval <A,B,0.99>


I think these are the main changes, but I probably forgot some :-)



-- 
e-mail:sme### [at] skynetbe

http://users.skynet.be/smellenbergh


Post a reply to this message

From: Dennis Milller
Subject: Re: isosurface MegaPov conversion to POV3.5
Date: 9 Sep 2001 20:56:23
Message: <3b9c0fb7$1@news.povray.org>
Merci Rene. This is a great help and will save me many hours of research.
Best,
Dennis
"smellenbergh" <sme### [at] skynetbe> wrote in message
news:1ezhnxz.1xl4pg916b2xyyN%smellenbergh@skynet.be...
>
> Here are some hints to convert syntax of MegaPov isosurface to 3.5
>
> * braces {} are required with functions
>   "function x+y"
> should be
>   "function {x+y}"
>
>
> * parameters of a declared function must be specified when called
>   #declare FUNC = function {x+y+z}
>   isosurface { function {FUNC} }
> should be
>   isosurface { function {FUNC(x,y,z)} }
>
>
> * using internal functions (See 7.7 functions.inc)
>   all internal functions are included in the functions.inc and start
> with
> "f_xxx". Parameters are set between ( ) braces and begin with the x,y,z
> parameters)
>    So, MegaPov's "sphere",<0.8>
> becomes
>   #include "functions.inc"
>   f_sphere(x,y,z,0.8)
> or, when declaring the function directly, without using the include
> file:
>   #declare MySphere = function { internal(61) }
>   isosurface{ function{ MySphere(x,y,z,0.8) } }
>
>
> * noise3d
>   in 3.5 noise3d is treated as an internal function: use the
> function.inc and
>   f_noise3d(x*4,y*4,z*4)/5
> Note that the noise uses pov's noise generator set in the global
> settings:
> global_settings{
>   noise_generator 1 file://old 3.1g plateaud noise
>   noise_generator 2 file://MegaPov 0.5 noise
>   noise_generator 3 file://New 3.5 perlin noise
> }
> ...or use
>   f_noise_generator(x,y,z, P0)
>     * P0 : Noise generator number
>
> *The func_ names have been renamed
>   func_0  >  f_ellipsoid
>   func_1  >  f_blob
>   func_2  >  f_flange_cover
>   func_2b  >  f_blob2
>   func_3  >  f_cross_ellipsoids
>   func_4  >  f_isect_ellipsoids
>   func_5  >  f_spikes
>   func_9  >  f_poly4
>   func_10  >  f_spikes_2d
>   func_11  >  f_quantum
>   func_12  >  f_helical_torus
>   func_13  >  f_comma
>   func_16  >  f_polytubes
> And the duplicate functions have been removed
>   helix1 / func_6  >  f_helix1
>   helix2 / func_7  >  f_helix2
>   spiral / func_8  >  f_spiral
>   mesh1 / func_14  >  f_mesh1
>
>
>
> * using function { pigments } in isosurfaces
>   the pigment must be declared. When calling it, the dot notation must
> be used: FUNC(x,y,z).x
> This allows to use the channels of the color vector in a controlled way
> Allowed are:
>   .x .u .red, .y .v .green, .z .t .blue, .filter, .transmit for the
> separate channels
>   .gray or .grey for the gray value of the color vector
>   .hf for the height_field value of the color vector (this was the
> method used in MegaPov)
>   #declare Granny = function{
>     pigment{
>       granite scale 3
>       color_map { [0 rgb 0] [1 rgb 1] }
>     }
>   }
>   isosurface{function{f_sphere(x,y,z,1)+Granny(x,y,z).hf*0.2}}
>
>
> * sign is no longer used in 3.5 isosurface
> to switch inside/outside, turn the whole function negative:
>   #declare Landscape = function { f_ridged_mf(x,y,z,1,2,10,1.1,2) }
>   isosurface{function{ Landscape(x,0,z)-y }
> becomes
>   isosurface{function{ -(Landscape(x,0,z)-y) }
>
>
> * sqr and cub no longer supported
>   use ^2 and ^3 ,or pow(A,2) and pow(A,3)
>
>
> * sqrt x^y and ln are used in the mathematical form in 3.5
>   Isosurface     MegaPov internal   3.5 internal
>   ----------     ---------------    ------------
>   sqrt(x)     =  sqrt(abs(x))       =sqrt(x)
>   x^y         =  abs(x)^y           =x^y
>   ln(x)       =  ln(abs(x))         =ln(x)
> So, these MegaPov functions might need to be written as they have been
> used internally in MegaPov to get the same results in 3.5
>
>
> * if(A,B,C)
>   has been replaced by select (A,C,B)
> MegaPov
>   isosurface {function {if(-x, abs(x)+abs(y)-0.5, sqrt(z^2+y^2)-0.5)}
> becomes in 3.5
>   isosurface{function{select(-x, sqrt(z^2+y^2)-0.5, abs(x)+abs(y)-0.5)}
>
>
> * method 1 and method 2
>   keywords no longer used in 3.5: a method 2-ish method is standard
>
>
> * eval
>   eval becomes evaluate and *requires* 3 parameters without the vector
> braces: evaluate A,B,0.99 which is the same as MegaPov's eval <A,B,0.99>
>
>
> I think these are the main changes, but I probably forgot some :-)
>
>

> --
> e-mail:sme### [at] skynetbe
>
> http://users.skynet.be/smellenbergh


Post a reply to this message

From: Mike Williams
Subject: Re: isosurface MegaPov conversion to POV3.5
Date: 10 Sep 2001 13:10:06
Message: <N8tIiKAuDOn7Ewvz@econym.demon.co.uk>
Wasn't it smellenbergh who wrote:

[Lots of extremely useful stuff]

>or, when declaring the function directly, without using the include
>file:
>  #declare MySphere = function { internal(61) }
>  isosurface{ function{ MySphere(x,y,z,0.8) } }

I'd guess that would be a bad idea. The "functions.inc" file is
insulating you from having to change your scene files whenever the
internal function numbers get changed. 'The ID's used to access the
internal functions through calls to "internal(XX)", are not guaranteed
to stay the same between POV-Ray versions.' (Help file 7.7)

If the authors keep the ID numbers in alphabetical order and a couple of
new ones get inserted you may well find that what you thought was a
sphere will become a ridged_multifractal.

>* sign is no longer used in 3.5 isosurface
>to switch inside/outside, turn the whole function negative:
>  #declare Landscape = function { f_ridged_mf(x,y,z,1,2,10,1.1,2) }
>  isosurface{function{ Landscape(x,0,z)-y }
>becomes
>  isosurface{function{ -(Landscape(x,0,z)-y) }

Note also that if your function used a threshold you must make that
negative too.
   threshold 0.5
becomes
   threshold -0.5

>I think these are the main changes, but I probably forgot some :-)

Also, some minor stuff.

MegaPOV accepted 
        contained_by {sphere 0,1}
3.5 requires the brackets
        contained_by {sphere {0,1}}

MegaPOV required a contained_by keyword
3.5 defaults to {box{-1,1}}

MegaPOV built-in function names were case independent
        "Sphere"
3.5 requires lower case
        f_sphere

MegaPOV isosurfaces never suffered from coincident surface artefacts.
3.5 isosurfaces that have coincident surfaces get the traditional
coincident surface speckles. (So the MegaPOV trick of avoiding "open"
containers by making an invisible surface coincident with your container
doesn't work. However, 3.5 doesn't have much of a speed penalty for
having an "open" container, so you don't need the trick.)

The parametric isosurface syntax is completely different.


There's also probably lots of really clever new stuff that can be done
because of the way that 3.5 functions have become more flexible. For
example, in MegaPOV you couldn't #declare functions that had extra
parameters. In 3.5 I can create an include file that declares functions
that take extra parameters just like the built in functions do.
    #declare Whitneys_Umbrella = function(x,y,z,A,B){A*x*x -B*y*y*z}
can then be referenced like
    isosurface {
      function { Whitneys_Umbrella(x, y, z, 2, -1) }
Whereas in MegaPOV if I wanted a Whitney's Umbrella (2,-1) and another
Whitney's Umbrella(1,1) I'd have had to #declare them separately.


I've so far found that the hardest bit of converting my isosurface
tutorial scene files (and I've done over 150 of them so far) is finding
a sensible max_gradient in situations where I had previously used the
MegaPOV defaults.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Rob Richards
Subject: Re: isosurface MegaPov conversion to POV3.5
Date: 21 Oct 2001 14:01:30
Message: <g836ttggsvfmeurpr6f34vg9en3pesog4m@4ax.com>
Hi There,

I have some megapov scenes that used the I_dat3d function  as below 

function{"data_3D_1", <1> library "i_dat3d" ........ }

I can't find anything in the docs about this function.

Does anyone know how/if I can convert these scene files ?

Cheers
Rob

On Sun, 9 Sep 2001 22:43:31 +0200, sme### [at] skynetbe
(smellenbergh) wrote:

>
>Here are some hints to convert syntax of MegaPov isosurface to 3.5 
>
>* braces {} are required with functions
>  "function x+y"
>should be
>  "function {x+y}"
>
>
>* parameters of a declared function must be specified when called
>  #declare FUNC = function {x+y+z}
>  isosurface { function {FUNC} }
>should be
>  isosurface { function {FUNC(x,y,z)} }
>
>
>* using internal functions (See 7.7 functions.inc)
>  all internal functions are included in the functions.inc and start
>with
>"f_xxx". Parameters are set between ( ) braces and begin with the x,y,z
>parameters)
>   So, MegaPov's "sphere",<0.8> 
>becomes 
>  #include "functions.inc"
>  f_sphere(x,y,z,0.8)
>or, when declaring the function directly, without using the include
>file:
>  #declare MySphere = function { internal(61) }
>  isosurface{ function{ MySphere(x,y,z,0.8) } }
>
>
>* noise3d
>  in 3.5 noise3d is treated as an internal function: use the
>function.inc and
>  f_noise3d(x*4,y*4,z*4)/5
>Note that the noise uses pov's noise generator set in the global
>settings:
>global_settings{
>  noise_generator 1 //old 3.1g plateaud noise
>  noise_generator 2 //MegaPov 0.5 noise
>  noise_generator 3 //New 3.5 perlin noise
>}
>...or use
>  f_noise_generator(x,y,z, P0)
>    * P0 : Noise generator number
>
>*The func_ names have been renamed
>  func_0  >  f_ellipsoid
>  func_1  >  f_blob
>  func_2  >  f_flange_cover
>  func_2b  >  f_blob2
>  func_3  >  f_cross_ellipsoids
>  func_4  >  f_isect_ellipsoids
>  func_5  >  f_spikes
>  func_9  >  f_poly4
>  func_10  >  f_spikes_2d
>  func_11  >  f_quantum
>  func_12  >  f_helical_torus
>  func_13  >  f_comma
>  func_16  >  f_polytubes
>And the duplicate functions have been removed
>  helix1 / func_6  >  f_helix1
>  helix2 / func_7  >  f_helix2
>  spiral / func_8  >  f_spiral
>  mesh1 / func_14  >  f_mesh1
>
>
>
>* using function { pigments } in isosurfaces
>  the pigment must be declared. When calling it, the dot notation must
>be used: FUNC(x,y,z).x
>This allows to use the channels of the color vector in a controlled way
>Allowed are:
>  .x .u .red, .y .v .green, .z .t .blue, .filter, .transmit for the
>separate channels
>  .gray or .grey for the gray value of the color vector
>  .hf for the height_field value of the color vector (this was the
>method used in MegaPov)
>  #declare Granny = function{
>    pigment{
>      granite scale 3
>      color_map { [0 rgb 0] [1 rgb 1] }
>    }
>  }
>  isosurface{function{f_sphere(x,y,z,1)+Granny(x,y,z).hf*0.2}}
>
>
>* sign is no longer used in 3.5 isosurface
>to switch inside/outside, turn the whole function negative:
>  #declare Landscape = function { f_ridged_mf(x,y,z,1,2,10,1.1,2) }
>  isosurface{function{ Landscape(x,0,z)-y }
>becomes
>  isosurface{function{ -(Landscape(x,0,z)-y) }
>
>
>* sqr and cub no longer supported
>  use ^2 and ^3 ,or pow(A,2) and pow(A,3)
>
>
>* sqrt x^y and ln are used in the mathematical form in 3.5
>  Isosurface     MegaPov internal   3.5 internal
>  ----------     ---------------    ------------
>  sqrt(x)     =  sqrt(abs(x))       =sqrt(x)
>  x^y         =  abs(x)^y           =x^y
>  ln(x)       =  ln(abs(x))         =ln(x)
>So, these MegaPov functions might need to be written as they have been
>used internally in MegaPov to get the same results in 3.5
>
>
>* if(A,B,C)
>  has been replaced by select (A,C,B)
>MegaPov
>  isosurface {function {if(-x, abs(x)+abs(y)-0.5, sqrt(z^2+y^2)-0.5)}
>becomes in 3.5
>  isosurface{function{select(-x, sqrt(z^2+y^2)-0.5, abs(x)+abs(y)-0.5)}
>
>
>* method 1 and method 2
>  keywords no longer used in 3.5: a method 2-ish method is standard
>
>
>* eval
>  eval becomes evaluate and *requires* 3 parameters without the vector
>braces: evaluate A,B,0.99 which is the same as MegaPov's eval <A,B,0.99>
>
>
>I think these are the main changes, but I probably forgot some :-)
>
>


Post a reply to this message

From: ingo
Subject: Re: isosurface MegaPov conversion to POV3.5
Date: 21 Oct 2001 14:36:51
Message: <Xns9141D1B29BEC9seed7@povray.org>
in news:g836ttggsvfmeurpr6f34vg9en3pesog4m@4ax.com Rob Richards wrote:

> function{"data_3D_1", <1> library "i_dat3d" ........ }
> 
> I can't find anything in the docs about this function.
> 
> Does anyone know how/if I can convert these scene files ?
> 

 These functions are not in 3.5. Maybe you can convert your source for 
the i_dat3d stuff to a df3-file (density file) and use that as a 
function. 


Ingo

-- 
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

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