POV-Ray : Newsgroups : povray.binaries.images : Holiday isosurface image based upon two df3s. Server Time
27 Dec 2024 05:08:25 EST (-0500)
  Holiday isosurface image based upon two df3s. (Message 1 to 2 of 2)  
From: William F Pokorny
Subject: Holiday isosurface image based upon two df3s.
Date: 17 Dec 2017 11:43:01
Message: <5a369e95@news.povray.org>
Happy Holidays!

The attached image was used for part of my end of year card to friends 
and family. Thought it might be of interest here as it is an isosurface 
created using two df3 files where both were derived from an old scanned 
slide. One df3 was used as the basis for the shapes; the second was used 
for the color.

The image for the shapes df3 was first run through Gimp's Pencil 
filter(1) after which the grey values were used to form the isosurface 
shapes. The image was used straight up for color values after being 
translated(2) to a 32 bit color encoded df3.

In another thread not too long ago, I quickly offered code for decoding 
color from a df3 and for using the resulting color channel functions in 
a pigment. A corrected, better template for doing such a thing is:

#declare DF3BitDepth = 32;
#declare DF3Depth = pow(2,DF3BitDepth)-1;
#declare ChanBitDepth = DF3BitDepth/4;
#declare ChanDepth = pow(2,ChanBitDepth);
#declare Rshift = pow(2,ChanBitDepth*3.0);
#declare Gshift = pow(2,ChanBitDepth*2.0);
#declare Bshift = pow(2,ChanBitDepth);
#declare FnR00 = function (x,y,z) { (FnPigDF3(x,y,z)*DF3Depth)/Rshift }
#declare FnG00 = function (x,y,z) { (FnPigDF3(x,y,z)*DF3Depth)/Gshift }
#declare FnB00 = function (x,y,z) { (FnPigDF3(x,y,z)*DF3Depth)/Bshift }
#declare FnF00 = function (x,y,z) { (FnPigDF3(x,y,z)*DF3Depth) }
#declare FnT00 = function (x,y,z) { (FnPigDF3(x,y,z)*DF3Depth) }
#declare FnR01 = function (x,y,z) {
     mod(FnR00(x,y,z),ChanDepth)/(ChanDepth-1)
}
#declare FnG01 = function (x,y,z) {
     mod(FnG00(x,y,z),ChanDepth)/(ChanDepth-1)
}
#declare FnB01 = function (x,y,z) {
     mod(FnB00(x,y,z),ChanDepth)/(ChanDepth-1)
}
#declare FnF01 = function (x,y,z) {
     mod(FnF00(x,y,z),ChanDepth)/(ChanDepth-1)
}
#declare FnT01 = function (x,y,z) {
     mod(FnT00(x,y,z),ChanDepth)/(ChanDepth-1)
}
#declare PigDF3 = pigment {
     user_defined {
         function { FnR01(x,y,z) },
         function { FnG01(x,y,z) },
         function { FnB01(x,y,z) },
         function { 0 },
         function { 0 }
     }
}

Bill P.

(1) - Gimp's pencil filter looks to have similarities to the image & 
blurred image gradient pencil method Kari Kivisalo, Zegar Knaepen and 
others played with many years ago in POV-Ray.

(2) - Turns out netpbm's PAM RGB_ALPHA tuple format works directly - 
less the pam text header - as a plane of a 32 bit 'color' df3. After 
creating a df3 file with the three, 16 bit, size header values, you can 
use the unix command:

'tail -c <tailByteCount> imageWithAlpha.pam >>color.df3'

to append a 'pam' plane for as many color planes as you want in the df3. 
(Yes, an image map would have been simpler for this 'flat-ish' isosurface)


Post a reply to this message


Attachments:
Download 'xmas2017.jpg' (962 KB)

Preview of image 'xmas2017.jpg'
xmas2017.jpg


 

From: jr
Subject: Re: Holiday isosurface image based upon two df3s.
Date: 17 Dec 2017 14:02:50
Message: <5a36bf5a$1@news.povray.org>
hi,

On 17/12/2017 16:42, William F Pokorny wrote:
> The attached image ...

wow.

and thank you for details and cli trick.

> Happy Holidays!

and to you.


regards, jr.


Post a reply to this message

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