<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.povray.org/content?action=history&amp;feed=atom&amp;title=User%3AWfpokorny%2FDensityFile%2FDepthMap64BitDf3RsltStoreExample</id>
	<title>User:Wfpokorny/DensityFile/DepthMap64BitDf3RsltStoreExample - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.povray.org/content?action=history&amp;feed=atom&amp;title=User%3AWfpokorny%2FDensityFile%2FDepthMap64BitDf3RsltStoreExample"/>
	<link rel="alternate" type="text/html" href="https://wiki.povray.org/content?title=User:Wfpokorny/DensityFile/DepthMap64BitDf3RsltStoreExample&amp;action=history"/>
	<updated>2026-10-09T03:47:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.povray.org/content?title=User:Wfpokorny/DensityFile/DepthMap64BitDf3RsltStoreExample&amp;diff=8661&amp;oldid=prev</id>
		<title>Wfpokorny: Initial 64 bit depth map example.</title>
		<link rel="alternate" type="text/html" href="https://wiki.povray.org/content?title=User:Wfpokorny/DensityFile/DepthMap64BitDf3RsltStoreExample&amp;diff=8661&amp;oldid=prev"/>
		<updated>2016-08-18T16:38:43Z</updated>

		<summary type="html">&lt;p&gt;Initial 64 bit depth map example.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;p&amp;gt;A 10x10 orthogonal, 64 bit, depth map using a few arraycoupleddf3s.inc macros.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The example prints trace(), vlength, depth values. The values are then stored in a df3 file after which a function is used to access and print the stored values. Lastly, it reads the created df3 into a second array and then writes a duplicate df3 file.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//----------------------------- Start example ---------------------------------------&lt;br /&gt;
#version 3.7;&lt;br /&gt;
global_settings { assumed_gamma 1 }&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;arrays.inc&amp;quot;           // For ARRAYS_WriteDF3()&lt;br /&gt;
#include &amp;quot;arraycoupleddf3s.inc&amp;quot; // Array coupled df3 macros &amp;amp; functions.&lt;br /&gt;
&lt;br /&gt;
#declare Sphere00=sphere { &amp;lt;0,0,10&amp;gt; 1.0 }&lt;br /&gt;
#declare Xn=10;&lt;br /&gt;
#declare Yn=10;&lt;br /&gt;
#declare Zn=9;&lt;br /&gt;
#declare AryDepth=array[Xn][Yn][Zn];&lt;br /&gt;
#declare Dx=1/Xn;&lt;br /&gt;
#declare Dy=1/Yn;&lt;br /&gt;
#declare Dz=1/Zn;&lt;br /&gt;
#declare Norm=&amp;lt;0,0,0&amp;gt;;&lt;br /&gt;
#declare Range=20.0;   // Using DBL's accuracy over limited range.&lt;br /&gt;
#for (Y,0,Yn-1)&lt;br /&gt;
  #debug &amp;quot;\n&amp;quot;&lt;br /&gt;
  #for (X,0,Xn-1)&lt;br /&gt;
    #local Xr=-0.5+(X*Dx)+(Dx/2);&lt;br /&gt;
    #local Yr=-0.5+(Y*Dy)+(Dy/2);&lt;br /&gt;
    #local tmpVal=vlength(trace(Sphere00,&amp;lt;Xr,Yr,0&amp;gt;,&amp;lt;0,0,1&amp;gt;,Norm)-&amp;lt;Xr,Yr,0&amp;gt;);&lt;br /&gt;
    NxNx9DBLtoArrayEntry(AryDepth,X,Y,Range,tmpVal)&lt;br /&gt;
    #debug concat(str(tmpVal,0,4),&amp;quot; &amp;quot;)&lt;br /&gt;
  #end&lt;br /&gt;
#end&lt;br /&gt;
#debug &amp;quot;\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#declare DepthFileName=&amp;quot;Depth.df3&amp;quot;;&lt;br /&gt;
ARRAYS_WriteDF3(AryDepth,DepthFileName,8) // Write +-64bit encoded depth measures&lt;br /&gt;
&lt;br /&gt;
#declare FnctDepthDF3=function{&lt;br /&gt;
  pattern{density_file df3 DepthFileName interpolate 0}&lt;br /&gt;
}&lt;br /&gt;
#declare FnctDepth=FnctNxNx9ArrayEntryToDBL(AryDepth,FnctDepthDF3)&lt;br /&gt;
//--- Write the DF3 stored DBL values to the screen.&lt;br /&gt;
#for (Y,0,Yn-1)&lt;br /&gt;
  #debug &amp;quot;\n&amp;quot;&lt;br /&gt;
  #for (X,0,Xn-1)&lt;br /&gt;
    #local Xi=(X*Dx)+(Dx/2);&lt;br /&gt;
    #local Yi=(Y*Dy)+(Dy/2);&lt;br /&gt;
    #debug concat(str(FnctDepth(Xi,Yi,Dz,Range),0,4),&amp;quot; &amp;quot;)&lt;br /&gt;
  #end&lt;br /&gt;
#end&lt;br /&gt;
&lt;br /&gt;
//--- Read the stored DF3 values into second array&lt;br /&gt;
#declare AryDepth2=array[Xn][Yn][Zn];&lt;br /&gt;
ARRAYS_ReadDF3(AryDepth2,DepthFileName)&lt;br /&gt;
&lt;br /&gt;
//--- And write a duplicate DF3 file&lt;br /&gt;
#declare DepthFileName2=&amp;quot;Depth2.df3&amp;quot;;&lt;br /&gt;
ARRAYS_WriteDF3(AryDepth2,DepthFileName2,8)&lt;br /&gt;
&lt;br /&gt;
#debug &amp;quot;\n\n&amp;quot;&lt;br /&gt;
#error &amp;quot;Stop before actual render for demonstration code.&amp;quot;&lt;br /&gt;
//------------------------------End example------------------------------------------&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wfpokorny</name></author>
	</entry>
</feed>