POV-Ray : Newsgroups : povray.general : Isosurface from PNG ? : Re: Isosurface from PNG ? Server Time
1 Aug 2024 10:15:15 EDT (-0400)
  Re: Isosurface from PNG ?  
From: Burki
Date: 18 Nov 2005 15:03:34
Message: <op.s0gcobttyrkrc2@rechner>
Am 06.11.2005, 19:05 Uhr, schrieb Bjorn Jonsson <bjj### [at] mmediais>:

> Is it possible to create an isosurface (heightfield on a sphere in this
> case) from a grayscale PNG image ?



Yes,

first declare a function like this:

#include "functions.inc"	

#declare fn_drop = function{
    pigment{
                 image_map {
                   png "your_file.png"
//                ================

                   map_type 1            // 1=spherical
                   interpolate 4         // 4=normalized distance
//                                         =====================
                 }
    }
}




And then call the isosurface:


isosurface {
         function { f_sphere (x, y, z, 1) - your_file.png (x,y,z).blue *  
0.1  }
//      ================================================or red or  
green========

         contained_by { sphere {0, 1.5} }

         open
         max_gradient 4

         texture {
		// your tex
         }

}


In this case, your ping will be substracted. This means that black part  
does nothing while white extends the radius of the f_sphere at that point.  
Fine tuning with the factor, start with 0.01 or 0.1 for a first test.


In the attachment find a working example of two files, the drops2 produces  
the file (Output_File_Type=N) that you need for the "BubbleSphere".


Yours,
Bu.


Post a reply to this message


Attachments:
Download 'bubble_sphere.zip' (2 KB)

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