POV-Ray : Newsgroups : povray.binaries.images : Creating internal image_map from function. Server Time
22 Dec 2024 13:21:41 EST (-0500)
  Creating internal image_map from function. (Message 1 to 4 of 4)  
From: William F Pokorny
Subject: Creating internal image_map from function.
Date: 16 Feb 2023 08:48:10
Message: <63ee341a$1@news.povray.org>
Given the recent discussions on creating height_fields from functions, I 
thought I'd mention a documented feature of POV-Ray I've not seen 
discussed on these newsgroup fora - that I recall.

It's possible to create an internal image_map from a function on the fly 
in SDL. The syntax is similar to defining a height_field (HF) with a 
function on the fly. The function (or pattern via a function) runs only 
during parsing. The rendering phase then references the internal 
image_map.

For example:

...
#declare Fn02 = function {
     pattern {
         radial sine_wave frequency 16
         translate (x+z)*0.5
         rotate x*-90
     }
}
#macro ImageMap01(_HF)
   #if (_HF=0)
     image_map { function 40, 40 { Fn02(x,y,z) }
   #else
     function 40, 40 { Fn02(x,y,z) }
   #end
   #if (_HF=0)
       map_type 0
       once
     //interpolate 2
     }
     warp { repeat x flip x }
     warp { repeat y flip y }
   #end
#end
#declare Pigment01 = pigment { ImageMap01(0) }
#declare Texture01 = texture { pigment { Pigment01 } }
#declare Box01 = box { 0,<2,2,0.1> }
#declare Obj01 = object {
     Box01
     texture { Texture01 }
     translate <-1.0,-1.0,0>
}
...

Bill P.


Post a reply to this message


Attachments:
Download 'fntointernalimage.jpg' (71 KB)

Preview of image 'fntointernalimage.jpg'
fntointernalimage.jpg


 

From: Thomas de Groot
Subject: Re: Creating internal image_map from function.
Date: 16 Feb 2023 09:03:20
Message: <63ee37a8$1@news.povray.org>
Op 16-2-2023 om 14:48 schreef William F Pokorny:
> Given the recent discussions on creating height_fields from functions, I 
> thought I'd mention a documented feature of POV-Ray I've not seen 
> discussed on these newsgroup fora - that I recall.
> 
> It's possible to create an internal image_map from a function on the fly 
> in SDL. The syntax is similar to defining a height_field (HF) with a 
> function on the fly. The function (or pattern via a function) runs only 
> during parsing. The rendering phase then references the internal image_map.
> 

Ah! That is nice indeed. I am currently playing with all this stuff 
since my revisiting in December 2022 of the JtaUR (Journey to an Unknown 
Region) and I can most probably integrate it. Thanks! Shall be back later.

-- 
Thomas


Post a reply to this message

From: yesbird
Subject: Re: Creating internal image_map from function.
Date: 16 Feb 2023 09:10:00
Message: <web.63ee3845f57ad3c2ca9e57c410800fb2@news.povray.org>
> It's possible to create an internal image_map from a function on the fly
> in SDL.

It works, thanks, so many possibility in POV !
It seams to me that this feature will be good for function's graph
representation, as it's possible to use original function as path of function
for colormap.

I will play with it this evening.
--
YB


Post a reply to this message

From: Bald Eagle
Subject: Re: Creating internal image_map from function.
Date: 16 Feb 2023 13:20:00
Message: <web.63ee7386f57ad3c21f9dae3025979125@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> Given the recent discussions on creating height_fields from functions, I
> thought I'd mention a documented feature of POV-Ray I've not seen
> discussed on these newsgroup fora - that I recall.

I think I asked clipka about it once, but I never got around to doing much with
it, and I can't recall seeing anything that jumped out in the documentation.

Thanks for the code/syntax example.    Those are always most helpful.

- BW


Post a reply to this message

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