POV-Ray : Newsgroups : povray.newusers : isosurface rendering of volume data : Re: isosurface rendering of volume data Server Time
28 Jul 2024 12:36:38 EDT (-0400)
  Re: isosurface rendering of volume data  
From: Mike Williams
Date: 30 Jun 2009 19:13:01
Message: <MQw1CADMvpSKFwzV@econym.demon.co.uk>
Wasn't it sanjay who wrote:
>Alain <aze### [at] qwertyorg> wrote:

>> > I have a stack of binary images i.e each image is a 2D array and
>> >all such images
>> > combined to give a 3D array.
>> > I had previously used MATLAB's isosurface,isocaps and patch functions to
>> > get the visualisation of the volume data, but its too slow.
>> > Is there a way by which I can import such a 3D volume data from
>> >matlab to POV
>> > ray and then extract the isosurfaces from that data and render it ?
>> >
>> >
>> Convert those image into the TGA format and use a tga to 3df combiner to
>> combine them in a single 3FD file.
>>
>> That file can then be used to generate an isosurface or as a density
>> pattern for a media.
>>
>> Alain
>
>I combined all my tga images into a .df3 file format
>then i m doing this
>
>#declare DENSFUNC=function
>{
>    pattern
>    {
>        density_file df3 "imoil.df3"
>        interpolate 3
>    }
>}
>isosurface {function { .2 - DENSFUNC(x,y,z) } }
>
>but just a blank screen is rendered.
>is my coding incorrect or do I need to alter the cam/light/threshold values ?

You may well need a higher max_gradient than the default value. Check
your messages pane to see if there's a warning to that effect.

Applying a pigment to your isosurface would help. By default it's black
on a black background.

Adding a light source to your scene would help. By default anything with
zero ambient looks black if it's unlit.

Adding a camera to your scene would help. By default the camera is
placed at <0,0,0> (which might possibly be just inside your object)
looking in the z direction.

Adding a contained_by won't improve the view, but might improve the
speed. The df3 exists in the positive octant of the unit sphere

Try this (adjusting max_gradient if you still get warnings):


camera { location  <1, 0.5, -5> look_at <0.5, 0.5, 0.5> angle 14}

light_source {<-100,200,-100> colour rgb 1}

#declare DENSFUNC=function
{
    pattern
    {
        density_file df3 "imoil.df3"
        interpolate 3
    }

isosurface {
  function { .2 - DENSFUNC(x,y,z) }
  max_gradient 50
  contained_by{box{-0.01,1.01}}
  pigment {rgb 1}
}


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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