POV-Ray : Newsgroups : povray.advanced-users : Height field old style? Server Time
23 Nov 2024 18:55:50 EST (-0500)
  Height field old style? (Message 1 to 8 of 8)  
From: Franz von Dardel
Subject: Height field old style?
Date: 31 Jan 2014 14:45:00
Message: <web.52ebfc19f1b27a0714d2732a0@news.povray.org>
I came across a file with a height field given in the following manner:

#declare Coul= pigment { color rgb <0.4,0.2,0>}

height_field {
    pattern 100,100 {
        hf_gray_16
        cylindrical color_map { [0 rgb 0] [1 rgb 1] }
        translate 1
        scale .3
    }
    //smooth
    pigment {Coul}
    clipped_by {plane {-y,-.05}}
    scale <5,2,5>
}

POV gives an error about "pattern":
Parse Error: Expected 'map file spec', pattern found instead
but I could not find the way to produce a height field without a GIF or PNG, or
a function. Is there a way to correct or convert the above lines?


Post a reply to this message

From: Le Forgeron
Subject: Re: Height field old style?
Date: 31 Jan 2014 15:28:35
Message: <52ec0773$1@news.povray.org>
Le 31/01/2014 20:40, Franz von Dardel nous fit lire :
> I came across a file with a height field given in the following manner:
> 
> #declare Coul= pigment { color rgb <0.4,0.2,0>}
> 
> height_field {
>     pattern 100,100 {
>         hf_gray_16
>         cylindrical color_map { [0 rgb 0] [1 rgb 1] }
>         translate 1
>         scale .3
>     }
>     //smooth
>     pigment {Coul}
>     clipped_by {plane {-y,-.05}}
>     scale <5,2,5>
> }
> 
> POV gives an error about "pattern":
> Parse Error: Expected 'map file spec', pattern found instead
> but I could not find the way to produce a height field without a GIF or PNG, or
> a function. Is there a way to correct or convert the above lines?
> 
> 

Does not seems to have ever been a valid povray official syntax.
Yet, might be some patch/extensions.

Does not seems to appear in megapov 1.2.1 (latest)
Or missing some lines ?

Traditional usage of pattern in height field requires to use function.

Such as:

#declare P1=function{pattern{leopard
   turbulence 0.3 scale 0.05}}
#declare P2=function{pattern{crackle
   turbulence 0.3 scale 0.7}}
#declare P=function{P1(x,0,z)*0.3 +P2(x,0,z)}

height_field{function 300,300 {P(x,0,y)}
  translate <-0.5,0,-0.5> ...


Post a reply to this message

From: clipka
Subject: Re: Height field old style?
Date: 31 Jan 2014 15:31:29
Message: <52ec0821$1@news.povray.org>
Am 31.01.2014 20:40, schrieb Franz von Dardel:
> I came across a file with a height field given in the following manner:
>
> #declare Coul= pigment { color rgb <0.4,0.2,0>}
>
> height_field {
>      pattern 100,100 {
>          hf_gray_16
>          cylindrical color_map { [0 rgb 0] [1 rgb 1] }
>          translate 1
>          scale .3
>      }
>      //smooth
>      pigment {Coul}
>      clipped_by {plane {-y,-.05}}
>      scale <5,2,5>
> }
>
> POV gives an error about "pattern":
> Parse Error: Expected 'map file spec', pattern found instead
> but I could not find the way to produce a height field without a GIF or PNG, or
> a function. Is there a way to correct or convert the above lines?

I think this should do the job (untested):

height_field {
      function 100,100 { pigment {
          hf_gray_16
          cylindrical color_map { [0 rgb 0] [1 rgb 1] }
          translate 1
          scale .3
      } }
      ...
}


Post a reply to this message

From: Alain
Subject: Re: Height field old style?
Date: 31 Jan 2014 22:08:10
Message: <52ec651a@news.povray.org>

> Am 31.01.2014 20:40, schrieb Franz von Dardel:
>> I came across a file with a height field given in the following manner:
>>
>> #declare Coul= pigment { color rgb <0.4,0.2,0>}
>>
>> height_field {
>>      pattern 100,100 {
>>          hf_gray_16
>>          cylindrical color_map { [0 rgb 0] [1 rgb 1] }
>>          translate 1
>>          scale .3
>>      }
>>      //smooth
>>      pigment {Coul}
>>      clipped_by {plane {-y,-.05}}
>>      scale <5,2,5>
>> }
>>
>> POV gives an error about "pattern":
>> Parse Error: Expected 'map file spec', pattern found instead
>> but I could not find the way to produce a height field without a GIF
>> or PNG, or
>> a function. Is there a way to correct or convert the above lines?
>
> I think this should do the job (untested):
>
> height_field {
>       function 100,100 { pigment {
>           hf_gray_16
>           cylindrical color_map { [0 rgb 0] [1 rgb 1] }
>           translate 1
>           scale .3
>       } }
>       ...
> }
>

I'm not sure about the hf_gray_16 in this context... Maybe it just does 
nothing.
Up to version 3.6.x, it was to be used in the global_settings block to 
output the image as a 16 bits gray level image.
With version 3.7, you use a command line switch to do the same.


Post a reply to this message

From: Franz von Dardel
Subject: Re: Height field old style?
Date: 1 Feb 2014 06:40:00
Message: <web.52ecdcad94a3ffcb14d2732a0@news.povray.org>
Alain <kua### [at] videotronca> wrote:

> > Am 31.01.2014 20:40, schrieb Franz von Dardel:
> >> I came across a file with a height field given in the following manner:
> >>
> >> #declare Coul= pigment { color rgb <0.4,0.2,0>}
> >>
> >> height_field {
> >>      pattern 100,100 {
> >>          hf_gray_16
> >>          cylindrical color_map { [0 rgb 0] [1 rgb 1] }
> >>          translate 1
> >>          scale .3
> >>      }
> >>      //smooth
> >>      pigment {Coul}
> >>      clipped_by {plane {-y,-.05}}
> >>      scale <5,2,5>
> >> }
> >>
> >> POV gives an error about "pattern":
> >> Parse Error: Expected 'map file spec', pattern found instead
> >> but I could not find the way to produce a height field without a GIF
> >> or PNG, or
> >> a function. Is there a way to correct or convert the above lines?
> >
> > I think this should do the job (untested):
> >
> > height_field {
> >       function 100,100 { pigment {
> >           hf_gray_16
> >           cylindrical color_map { [0 rgb 0] [1 rgb 1] }
> >           translate 1
> >           scale .3
> >       } }
> >       ...
> > }
> >
>
> I'm not sure about the hf_gray_16 in this context... Maybe it just does
> nothing.
> Up to version 3.6.x, it was to be used in the global_settings block to
> output the image as a 16 bits gray level image.
> With version 3.7, you use a command line switch to do the same.

I have tried function instead of pattern. Doesn't work. It (logically) expects a
function.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Height field old style?
Date: 1 Feb 2014 07:57:32
Message: <52ecef3c$1@news.povray.org>
pattern 100, 100

feels vaguely familiar to me, something from the deep past maybe, but I
cannot find any file in my 15 years old archives that uses this
configuration.

However, searching the web, I came across this:
http://www.cs.trinity.edu/~jhowland/class.files.cs357.html/pov-new/MegaPOV/demos/textures/patterns/pattern_hf.pov

This clearly refers to MegaPOV 0.4, in 1999. I don't know what that did 
in particular compared to POV-Ray back then, but I guess that it was one 
of the first possibilities to use functions in a height_field. I do not 
have version 0.4 any more so I cannot check.

Comments by Le_Forgeron and Alain are the way to go.

Thomas


Post a reply to this message

From: Thomas de Groot
Subject: Re: Height field old style?
Date: 1 Feb 2014 08:07:14
Message: <52ecf182$1@news.povray.org>
And this is the documentation of pattern found on the same site. Note 
the facultative use hf_gray_16.

[quote]
8.4. Pattern Image Type

Author: Ronald L. Parker

pattern Width, Height { [hf_gray_16] PIGMENT }

This keyword defines a new bitmap image type. The pixels of the image 
can be derived from any standard pigment. This image may be used 
wherever a tga image may be used. Some uses include creating 
heightfields from procedural textures or wrapping a 2d texture such as 
hexagons around a cylinder (though a better way to do this is with the 
new cylindrical warp.)

A pattern statement be used wherever an image specifier like tga or png 
may be used. Width and Height specify the resolution of the resulting 
bitmap image. The pigment body may contain transformations. If present, 
they apply only to the pigment and not to the object as a whole.

This image type currently ignores any filter values that may be present 
in the pigment, but it keeps transparency information. If present, the 
hf_gray_16 specifier causes POV-Ray to create an image that uses the TGA 
16-bit red/green mapping.

Example:

#declare QuickLandscape =
height_field {
   pattern 200,200 {
     hf_gray_16
     bozo
     color_map {
       [0 rgb 0]
       [1 rgb 1]
     }
   }
}
[/quote]


Thomas


Post a reply to this message

From: clipka
Subject: Re: Height field old style?
Date: 1 Feb 2014 17:28:09
Message: <52ed74f9$1@news.povray.org>
Am 01.02.2014 12:38, schrieb Franz von Dardel:

>>> I think this should do the job (untested):
>>>
>>> height_field {
>>>        function 100,100 { pigment {
>>>            hf_gray_16
>>>            cylindrical color_map { [0 rgb 0] [1 rgb 1] }
>>>            translate 1
>>>            scale .3
>>>        } }
>>>        ...
>>> }
>>>
>>
>> I'm not sure about the hf_gray_16 in this context... Maybe it just does
>> nothing.
>> Up to version 3.6.x, it was to be used in the global_settings block to
>> output the image as a 16 bits gray level image.
>> With version 3.7, you use a command line switch to do the same.
>
> I have tried function instead of pattern. Doesn't work. It (logically) expects a
> function.

Then try this one:

#declare MyFn = function { pigment {
   cylindrical color_map { [0 rgb 0] [1 rgb 1] }
   translate 1
   scale .3
} }

height_field {
   function 100,100 { MyFn(x,0,z) }
   ...
}

or, maybe:

height_field {
   function 100,100 { MyFn(x,0,z).red }
   ...
}


Post a reply to this message

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