POV-Ray : Newsgroups : povray.general : using image as a function hf_macro Server Time
18 Nov 2024 15:23:26 EST (-0500)
  using image as a function hf_macro (Message 1 to 6 of 6)  
From: Shay
Subject: using image as a function hf_macro
Date: 1 Aug 2002 13:27:11
Message: <3d496f6f$1@news.povray.org>
I would like to try the new heightfield macros using an image as the
function, but have not been able to get the syntax right. Would someone mind
posting an example?

 -Shay


Post a reply to this message

From: Christopher James Huff
Subject: Re: using image as a function hf_macro
Date: 1 Aug 2002 14:28:55
Message: <chrishuff-FADE10.13200201082002@netplex.aussie.org>
In article <3d496f6f$1@news.povray.org>, "Shay" <sah### [at] simcopartscom> 
wrote:

> I would like to try the new heightfield macros using an image as the
> function, but have not been able to get the syntax right. Would someone mind
> posting an example?

function {pigment {image_map {...}}}

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

From: Shay
Subject: Re: using image as a function hf_macro
Date: 1 Aug 2002 15:08:50
Message: <3d498742@news.povray.org>
Christopher James Huff <chr### [at] maccom> wrote in message
news:chr### [at] netplexaussieorg...
>
> function {pigment {image_map {...}}}
>

This is what I have been trying. I am getting an error, however.
--Parse Error: Expected 'string', colour identifier found instead--

I guess I am doing something else wrong. Here is the relevant part of the
scene:
#declare ImageFunction = function {pigment {image_map {png "name2.png" }}};
#include "Shapes.inc"

HF_Square (ImageFunction,no,no,<10,10>,no,"Test_Out.inc",<-1,-1,-1>,<1,1,1>)


 -Shay


Post a reply to this message

From: Christopher James Huff
Subject: Re: using image as a function hf_macro
Date: 1 Aug 2002 17:57:35
Message: <chrishuff-4E3775.16484301082002@netplex.aussie.org>
In article <3d498742@news.povray.org>, "Shay" <sah### [at] simcopartscom> 
wrote:

> I guess I am doing something else wrong. Here is the relevant part of the
> scene:
> #declare ImageFunction = function {pigment {image_map {png "name2.png" }}};
> #include "Shapes.inc"
> 
> HF_Square (ImageFunction,no,no,<10,10>,no,"Test_Out.inc",<-1,-1,-1>,<1,1,1>)

It expects a scalar float value instead of the color the pigment image 
gives. Try "function {ImageFunction(x, y, z).gray}"

I thought there was another keyword that used the same algorithm the 
height field object uses to get a float value from a color, but I guess 
it didn't make it into the final release. The ".gray" method should be 
close enough for most purposes though.

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

From: Marc-Hendrik Bremer
Subject: Re: using image as a function hf_macro
Date: 2 Aug 2002 03:04:46
Message: <3d4a2f0e@news.povray.org>
"Christopher James Huff" <chr### [at] maccom> schrieb im Newsbeitrag
news:chr### [at] netplexaussieorg...

> I thought there was another keyword that used the same algorithm the
> height field object uses to get a float value from a color, but I guess
> it didn't make it into the final release. The ".gray" method should be
> close enough for most purposes though.

The other one was .hf, which is still useable, but marked as "experimental
feature".

Marc-Hendrik


Post a reply to this message

From: Shay
Subject: Re: using image as a function hf_macro
Date: 2 Aug 2002 10:35:27
Message: <3d4a98af$1@news.povray.org>
Christopher James Huff <chr### [at] maccom> wrote in message
news:chr### [at] netplexaussieorg...
>
> It expects a scalar float value instead of the color the pigment image
> gives. Try "function {ImageFunction(x, y, z).gray}"
>

This solved the problem. Thank you for your help.

 -Shay


Post a reply to this message

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