POV-Ray : Newsgroups : povray.unofficial.patches : Error in Megapov documentation. : Error in Megapov documentation. Server Time
1 Sep 2024 16:13:45 EDT (-0400)
  Error in Megapov documentation.  
From: Michael Andrews
Date: 14 Feb 2001 13:24:39
Message: <3A8ACD35.6258304@reading.ac.uk>
Hi folks,

This is about using an array of data with the i_dat3d library functions.

From the documentation (the very last bit of ss5.2.11), given an array
defind as

#declare Size = <37,23,17>;
#declare Data = array [Size.x][Size.y][Size.z]
  
I would expect to use the "data_3d_1" function by declaring 

#declare fn_Data = function { 
  "data_3d_1", <1> 
  library "i_dat3d", 
  Data, <Size.x,Size.y,Size.z> 
}

and using it as

#declare O_Data = isosurface {
  function { fn_Data }
  threshold 0.1
  sign -1
  contained_by { box { 0, Size } }
  eval
  pigment { colour rgb 1 }
}

for instance. Unfortunately this just gives me a jumbled mess.

With a little experimentation I found that using 

#declare fn_Data = function { 
  "data_3d_1", <1> 
  library "i_dat3d", 
  Data, <Size.z,Size.y,Size.x> // <- Reversed
}
#declare O_Data = isosurface {
  function { fn_Data(z,y,x) }  // <- Reversed
  threshold 0.1
  sign -1
  contained_by { box { 0, Size } }
  eval
  pigment { colour rgb 1 }
}

gives the correct result. I seem to remember DF3 files are defined in
this reversed way internally, so that's probably where this reversal
comes from. The effect is easy to compensate for if you know about it,
so there's no real point delving into the source code to sort it out,
but the documentation could perhaps be updated to mention this?

I'll post a small test file in p.b.s-f.

Bye for now,
	Mike Andrews.


Post a reply to this message

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