POV-Ray : Newsgroups : povray.general : Isosurface from PNG ? Server Time
31 Oct 2024 10:24:31 EDT (-0400)
  Isosurface from PNG ? (Message 1 to 4 of 4)  
From: Bjorn Jonsson
Subject: Isosurface from PNG ?
Date: 6 Nov 2005 13:05:01
Message: <MPG.1dd85607904b1ba4989695@news.povray.org>
Is it possible to create an isosurface (heightfield on a sphere in this 
case) from a grayscale PNG image ? What I have in mind is something 
comparable to a surface object where this is easy to do but it doesn't 
look obvious to me how to do this with an isosurface if it is possible.

-- 
Bjorn Jonsson / http://www.mmedia.is/bjj


Post a reply to this message

From: Christoph Hormann
Subject: Re: Isosurface from PNG ?
Date: 6 Nov 2005 13:34:38
Message: <dkli95$q8q$1@chho.imagico.de>
Bjorn Jonsson wrote:
> Is it possible to create an isosurface (heightfield on a sphere in this 
> case) from a grayscale PNG image ? What I have in mind is something 
> comparable to a surface object where this is easy to do but it doesn't 
> look obvious to me how to do this with an isosurface if it is possible.
> 

http://www.imagico.de/pov/ic/docu02.html#HF_Sphere

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.imagico.de/ (Last updated 31 Oct. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

From: Burki
Subject: Re: Isosurface from PNG ?
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)

From: Burki
Subject: Re: Isosurface from PNG ?
Date: 18 Nov 2005 15:10:01
Message: <web.437e348d261969f2d61e8c370@news.povray.org>
sorry, my fault:

isosurface {
        function { f_sphere (x, y, z, 1) - fn_drop (x,y,z).blue * 0.1  }
//                                         ======= your function =======


Bu.


Post a reply to this message

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