<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Holographer &#124; Holography &#187; Holographers</title>
	<atom:link href="http://holographer.org/tag/holographers/feed/" rel="self" type="application/rss+xml" />
	<link>http://holographer.org</link>
	<description>holographer.org</description>
	<lastBuildDate>Tue, 10 Jan 2012 10:32:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>HoloPov: A previsualization program for holographers (version 0.5)</title>
		<link>http://holographer.org/holopov-a-previsualization-program-for-holographers-version-05/</link>
		<comments>http://holographer.org/holopov-a-previsualization-program-for-holographers-version-05/#comments</comments>
		<pubDate>Thu, 29 Apr 2004 18:43:09 +0000</pubDate>
		<dc:creator>Kaveh</dc:creator>
				<category><![CDATA[Optics]]></category>
		<category><![CDATA[Article]]></category>
		<category><![CDATA[Holographers]]></category>
		<category><![CDATA[Holography]]></category>
		<category><![CDATA[HoloPov]]></category>
		<category><![CDATA[Kaveh Bazargan]]></category>
		<category><![CDATA[PovRay]]></category>
		<category><![CDATA[Ray tracing]]></category>
		<category><![CDATA[Revolution]]></category>
		<category><![CDATA[RunRev]]></category>

		<guid isPermaLink="false">http://wordpress.holographer.net/?p=564</guid>
		<description><![CDATA[
Kaveh Bazargankaveh@holographer.org
About the authorKaveh&#x2019;s interest began with seeing the Royal Academy of Arts exhibition of holograms in London in 1976. He was studying physics at Imperial College London, and continued to complete a PhD in &#x2018;display holography&#x2019;. His passion remains the quest to achieve ultimate realism with holography.


Download PDF
Over the years I have often wanted [...]]]></description>
			<content:encoded><![CDATA[<div class="author-data">
<p><a href="http://wordpress.holographer.net/wp-content/uploads/2009/06/bazargan-photo.jpg"><img src="http://wordpress.holographer.net/wp-content/uploads/2009/06/bazargan-photo.jpg" alt="Kaveh Bazargan" title="Kaveh Bazargan" width="100" height="121" class="alignleft size-full wp-image-565" /></a><span class="author">Kaveh Bazargan</span><br /><span><a href="mailto:kaveh@holographer.org">kaveh@holographer.org</a></span></p>
<p class="bio"><strong>About the author</strong><br />Kaveh&#x2019;s interest began with seeing the Royal Academy of Arts exhibition of holograms in London in 1976. He was studying physics at Imperial College London, and continued to complete a PhD in &#x2018;display holography&#x2019;. His passion remains the quest to achieve ultimate realism with holography.</p>
</div>
<p><span id="more-564"></span></p>
<div class="download-pdf"><a href="/media/articles/hg00008.pdf" target="_blank">Download PDF</a></div>
<p>Over the years I have often wanted to be able to simulate the recording and reconstruction process in holograms. I am particularly interested in display holograms, as opposed to HOEs. During my studies I did write little programs for specific cases, but not a general purpose program. There are two parts to such a program: first to calculate the reconstructed image, having fed in the the recording data, and second, to present this in a nice graphical form, preferably three-dimensional.</p>
<p>Recently I discovered <i>POV-ray</i> (<a href="http://www.povray.org" target="_blank">http://www.povray.org</a>), a 3D image rendering engine, and realised it was the ideal tool for the job. Please see the the amazing images people have created with it. <i>POV-ray</i> is free, platform-independent (Linux, Unix, Macintosh, Windows), and produces images equal to renderers at <i>any</i> price. The beauty of using <i>POV-ray</i> is that not only is it a superb 3D rendering engine, but it is also an excellent programming language. Never calling myself a <i>real</i> programmer, I slowly put some equations in, got results, and soon got carried away! Slowly I built in more capability. The more I work on it the more possibilities I see to simulate the holographic process. I can now see that we can simulate full color holograms, &#x2018;pseudocolour&#x2019; holograms, and rainbow holograms. At the moment it is limited to transmission holograms, but I hope to extend it to reflection holograms too. </p>
<p>The basic equations used are those of Champagne (<i>J.&nbsp;Opt.&nbsp;Soc.&nbsp;Amer.</i>&nbsp;57 (1967)&nbsp;p.&nbsp;51). In this document I&#x2019;ll not go into the equations, but just the functionality of the program. This version is really still being worked on, and there will be bugs, so I do appreciate feedback. </p>
<p class="section-head">License</p>
<p>HoloPov is released under the GNU LGPL license (see <a href="http://www.fsf.org/licenses/licenses.html#LGPL" target="_blank">http://www.fsf.org/licenses/licenses.html#LGPL</a>). The code is therefore &#x2018;open&#x2019; and you can modify it and use it free of charge, and to redistribute it, within the restrictions of the license. In the spirit of Free Software, I encourage people to test and modify the code to improve and debug it, and help serve the holographic                                                                                                                                        community. </p>
<p class="section-head">Requirements</p>
<p>You should be running <i>POV-ray</i> on your computer. I have used version&nbsp;3.5. The files should run with any installation of <i>POV-ray</i> above 3.5. <i>POV-ray</i> runs on most platforms and is device independent. </p>
<p class="section-head">Examples</p>
<p>To see some examples of the kind of output produced, please see my other article, <a href="../hg00009/hg00009.pdf">&#x201C;White light transmission holograms&#x201D;</a> </p>
<p class="section-head">Availability</p>
<p>HoloPov is available for download <a href="/media/holopov-0.5.zip">here</a>.
</p>
<p class="section-head">File structure</p>
<p>There are three files in the package, <span class="obeylines-h"><span class="verb">holopov.pov</span></span> and <span class="obeylines-h"><span class="verb">holopov.inc</span></span>, and <span class="obeylines-h"><span class="verb">optics.inc</span></span>. You will also need to get <span class="obeylines-h"><span class="verb">CIE.inc</span></span> from <a href="http://www.ignorancia.org/zips/lightsys4.zip">http://www.ignorancia.org/zips/lightsys4.zip</a>. <span class="obeylines-h"><span class="verb">holopov.pov</span></span> is the file that is run through <i>POV-ray</i>. It will <span class="obeylines-h"><span class="verb">#include</span></span> <span class="obeylines-h"><span class="verb">holopov.inc</span></span> which will in turn <span class="obeylines-h"><span class="verb">#include</span></span> several other files. Most of these are standard files distributed with <i>POV-ray</i>, but <span class="obeylines-h"><span class="verb">optics.inc</span></span> is a library file of mine, and <span class="obeylines-h"><span class="verb">CIE.inc</span></span> is a third party file which, amongst other things, works out the approximate color for a given wavelength. </p>
<p class="section-head">The coordinate system</p>
<p>We use the coordinate system of <i>POV-ray</i>, i.e.&nbsp;a <i>left-handed</i> cartesian system. The hologram is always in the <i>x</i>&#x2013;<i>y</i> plane, centered at the origin. If you imagine your computer screen as being the hologram, with the <i>x</i>-axis pointing to the right, and <i>y</i>                                                                                                                                        pointing up, then the <i>z</i>-axis will be pointing into the screen. The center of the screen is <span class="obeylines-h"><span class="verb">&lt;0,0,0&gt;</span></span> </p>
<p>I have chosen to have the observer in the z &lt; 0 region, and other points in the z &gt; 0. But I think that any point can have any coordinates. If the formulae have been coded properly, then this should be the case <i>I think</i>. I have not dared test this yet! </p>
<p class="section-head">Overall concept</p>
<p>The basic idea is that you dial in the recording and the reconstruction parameters, and the program will work out the position of the image. By &#x2018;parameters&#x2019;, I mean the following:
</p>
<ul class="itemize1">
<li class="itemize">position of the object
     </li>
<li class="itemize">position of the recording source
     </li>
<li class="itemize">position of the reconstruction source
     </li>
<li class="itemize">position of the observer
     </li>
<li class="itemize">recording wavelength
     </li>
<li class="itemize">reconstruction wavelength</li>
</ul>
<p>All these values are entered into the main file, i.e.&nbsp;<span class="obeylines-h"><span class="verb">holopov.pov</span></span>.
</p>
<p class="section-head">The object</p>
<p>These are the parameters that define the object:</p>
<ul class="itemize1">
<li class="itemize"><span class="obeylines-h"><span class="verb">obj_dist</span></span>      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">obj_angle</span></span>                                                                                                                                             </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">obj_side_angle</span></span>      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">obj_theta</span></span>      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">object_size</span></span>      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">grid_sep</span></span></li>
</ul>
<p>After a lot of thought, I decided that spherical polar coordinates were the best way to enter the data for the object, at least for me. </p>
<p><span class="obeylines-h"><span class="verb">obj_dist</span></span> is the distance of the center of the object from the origin, i.e.&nbsp;from the center of the plate. This value is always positive. </p>
<p><span class="obeylines-h"><span class="verb">obj_angle</span></span> is the angle of the object in the <i>y</i>&#x2013;<i>z</i> plane, i.e.&nbsp;above or below the horizon. </p>
<p><span class="obeylines-h"><span class="verb">obj_side_angle</span></span> is the angle of the object in the <i>x</i>&#x2013;<i>z</i> plane, i.e.&nbsp;the angle if we were looking directly from above. </p>
<p><span class="obeylines-h"><span class="verb">obj_theta</span></span> is the angle around the <i>y</i>-axis. This the angle one would see if one were looking down the <i>y</i>-axis from above. </p>
<p>To have an object in the observer space, i.e.&nbsp;z &lt; 0, we can use values of <span class="obeylines-h"><span class="verb">obj_theta,&nbsp;obj_angle</span></span> &gt; 90<sup >&#x2218;</sup> or &lt; &#x2212;90<sup >&#x2218;</sup>. </p>
<p><span class="obeylines-h"><span class="verb">object_size</span></span> needs some explanation. I have defined an object to be not just a point, but a 3-dimensional grid of points. The three coordinates in <span class="obeylines-h"><span class="verb">object_size</span></span> define the extent of the image in each axis. For example <span class="obeylines-h"><span class="verb">&lt;2,2,2&gt;</span></span> means a cube, with dimension <span class="obeylines-h"><span class="verb">2</span></span> on each side. <span class="obeylines-h"><span class="verb">grid_sep</span></span> defines the distance between successive grid points. The smaller the value of <span class="obeylines-h"><span class="verb">grid_sep</span></span>, the more grid points will be present. If <span class="obeylines-h"><span class="verb">object_size</span></span> is set to <span class="obeylines-h"><span class="verb">&lt;2,0,2&gt;</span></span>, the grid will effectively be a sheet, with zero height. </p>
<p>Please note that values corresponding to object distance and angle refer to the average object position, i.e.&nbsp;the center of the object. </p>
<p class="section-head">Recording geometry</p>
<p>Here are the values to set:</p>
<ul class="itemize1">
<li class="itemize"><span class="obeylines-h"><span class="verb">ref_dist</span></span>      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">ref_angle</span></span>                                                                                                                                             </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">ref_side_angle</span></span>      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">ref_theta</span></span>      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">lambda_r</span></span></li>
</ul>
<p>Again we use spherical polar coordinates. <span class="obeylines-h"><span class="verb">lambda_r</span></span> is the wavelength used for recording the hologram. Again we should be able to use angles &gt; 90<sup >&#x2218;</sup> and &lt; &#x2212;90<sup >&#x2218;</sup> to have, for example, a converging beam. I need to do a bit more thinking on this. For example, how to distinguish between a converging beam and a diverging beam, both referring to the same point in space. I hope that we can have a sign system that caters for all combinations. </p>
<p class="section-head">Reconstruction geometry</p>
<p>Here are the corresponding values in reconstruction:</p>
<ul class="itemize1">
<li class="itemize"><span class="obeylines-h"><span class="verb">rec_dist</span></span>
     </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">rec_angle</span></span>
     </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">rec_side_angle</span></span>
     </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">rec_theta</span></span>
     </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">lambda_c</span></span></li>
</ul>
<p class="section-head">Observer</p>
<p>These values define the observer:</p>
<ul class="itemize1">
<li class="itemize"><span class="obeylines-h"><span class="verb">obs_dist</span></span>                                                                                                                                             </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">obs_angle</span></span>      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">obs_side_angle</span></span></li>
</ul>
<p>I have been using angles of zero, and a negative observer distance to signify an observer on the <i>z</i>-axis, but to be consistent with above. </p>
<p class="section-head">Camera settings</p>
<p>These are the more or less standard settings used in <i>POV-ray</i> for the camera:</p>
<ul class="itemize1">
<li class="itemize"><span class="obeylines-h"><span class="verb">camera_loc</span></span> &#x2013; The camera position. Presently in cartesian coordinated,      but might be better to change it to polar in future releases.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">camera_look</span></span> &#x2013; Center of the rendered image.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">camera_angle</span></span> &#x2013; As in the normal <i>POV-ray</i> definition. To zoom in, we      decrease this value.      </li>
</ul>
<p class="section-head">H1 and H2</p>
<p>I have managed to simulate the effect of having a master hologram, or as it is normally referred to, the H1. The hologram doing the final imaging, I will always refer to as the H2. The dimensions of the two plates are set by:</p>
<ul class="itemize1">
<li class="itemize"><span class="obeylines-h"><span class="verb">h1_width</span></span>      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">h1_height</span></span>      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">h2_width</span></span>                                                                                                                                             </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">h2_height</span></span></li>
</ul>
<p>The main reason for setting the dimensions of the two plates is to take into account the image cut-off, or vignetting, that occurs as the viewer moves around. We also need a value to define the position of the H1 relative to H2. We could of course give the distance between the two, but I have opted to define <span class="obeylines-h"><span class="verb">h1_sep</span></span>, which is the distance from the center of the object to that of the H1. So as we change the position of the object, all other values being equal, we are also implicitly changing that of the H1. </p>
<p class="section-head">Options</p>
<p>I have put in a lot of options which have a bearing on how the final image is drawn. These are set as parameters that are tested later in <span class="obeylines-h"><span class="verb">holopov.inc</span></span>. A value of 0 implies the value is false, any other value sets the value to true. Here are the list of options now available: </p>
<ul class="itemize1">
<li class="itemize"><span class="obeylines-h"><span class="verb">object_points_true</span></span> &#x2013;  Draws  a  sphere  at  each  object  grid  point.      The  color  is  a  color  approximating  to  the  recording  wavelength.  This      is  achieved  by  the  <span class="obeylines-h"><span class="verb">Wavelength()</span></span> macro  in  <span class="obeylines-h"><span class="verb">CIE.inc</span></span> (see  the  file  for      details). The radius of the sphere is determined by <span class="obeylines-h"><span class="verb">object_sphere_rad</span></span>      in <span class="obeylines-h"><span class="verb">holopov.inc</span></span>.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">object_grid_true</span></span> &#x2013; Joins up the object grid points with cylinders, color      as  above.  The  radius  of  the  cylinder  is  set  by  <span class="obeylines-h"><span class="verb">grid_cylinder_rad</span></span> in      <span class="obeylines-h"><span class="verb">holopov.inc</span></span>.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">image_points_true</span></span> &#x2013;  As  with  <span class="obeylines-h"><span class="verb">object_points_true</span></span>,  but  for  image      points. Color corresponds to the reconstruction wavelength. Radius is set      by <span class="obeylines-h"><span class="verb">image_sphere_rad</span></span>. I have set the object and image radii separately.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">image_grid_true</span></span> &#x2013; As with <span class="obeylines-h"><span class="verb">object_grid_true</span></span>, but for the image. The      radius of the cylinder is set by <span class="obeylines-h"><span class="verb">grid_cylinder_rad</span></span>.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">ref_beam_true</span></span> &#x2013; Draws four lines from the reference point to the four      corners of the recording plate. The &#x2018;lines&#x2019; are actually cones which taper      to zero at the reference point. The maximum radius of the cone is equal      to <span class="obeylines-h"><span class="verb">ray_radius</span></span>. Color approximates to the reference wavelength.                                                                                                                                             </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">rec_beam_true</span></span> &#x2013;  As  with  <span class="obeylines-h"><span class="verb">ref_beam_true</span></span>,  but  for  the  reconstruction      beam. Color as expected.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">obj_beam_true</span></span> &#x2013; Draws a cylinder from the center of the plate to the      position of the observer. Color that of the recording wavelength, radius      set by <span class="obeylines-h"><span class="verb">ray_radius</span></span>.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">image_beam_true</span></span> &#x2013; Joins the center of the image to the observer position.      The  section  from  the  observer  to  the  plate  is  a  solid  cylinder,  radius      determined by <span class="obeylines-h"><span class="verb">ray_radius</span></span>, and the section from the plate to the image      is  drawn  as  a  dotted  line.  Paramters  for  this  are  <span class="obeylines-h"><span class="verb">dotted_space</span></span> and      <span class="obeylines-h"><span class="verb">dotted_ray_rad</span></span>.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">eye_true</span></span> &#x2013; Draws a pair of eyes, a bit evil looking at present, at the      observer position, and looking at the center of the image.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">plate_true</span></span> &#x2013; Draws the recording plate, the dimensions of which are      determined by <span class="obeylines-h"><span class="verb">Plate</span></span>, in <span class="obeylines-h"><span class="verb">holopov.inc</span></span>. I have left this in the <span class="obeylines-h"><span class="verb">.inc</span></span> file,      as I have not had to change it much, but it can be moved to the main      <span class="obeylines-h"><span class="verb">.pov</span></span>&nbsp;file.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">vignette_true</span></span> &#x2013; This option will draw only those parts of the image      which would be visible with the geometry described, i.e.&nbsp;the image will      be cut off at the edges of the plate.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">disp_comp_true</span></span>  &#x2013;   Uses   &#x2018;dipersion   compensation&#x2019;.   This   means   it      disregards the value set for <span class="obeylines-h"><span class="verb">rec_angle</span></span>, and adjusts it so that the image is      reconstructed as close to the object position as possible. In other words,      it compensates for lateral chromatic dispersion.      </li>
</ul>
<p class="section-head">H1 and H2 options</p>
<p>We&#x2019;ll list the H2 options first, as the the H2 is always present, but H1 is optional: </p>
<ul class="itemize1">
<li class="itemize"><span class="obeylines-h"><span class="verb">h2_visible</span></span> &#x2013; This just means that the H2 plate is drawn in the final      rendering. Sometimes it might be best not to draw it.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">h2_vignette_true</span></span> &#x2013;  This  will  simulate  the  vignetting  effect,  or  the      cut-off, of the h2. In other words, an image point is drawn only when the      straight line from that point to the eye intersects with the H2. This works      for real and virtual images.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">h2_vignette_visible</span></span> &#x2013; This draws a faint volume in space, rather like      a distorted pyramid, showing how the vignetting works. It is included for      educational purposes.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">h1_visible</span></span> &#x2013; As above, but shows the H1. I have only tried this in viewer      space, i.e.&nbsp;a real image of the H1 projected, but it should work in the case      of a virtual image too.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">h1_vignette_true</span></span> &#x2013;  As  with  H2,  but  this  is  far  more  important  for      holgraphers, as it determines the viewing angle for the image.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">h1_vignette_visible</span></span> &#x2013; As with H2.</li>
</ul>
<p class="section-head">Camera options</p>
<ul class="itemize1">
<li class="itemize"><span class="obeylines-h"><span class="verb">camera_observer_true</span></span> &#x2013; The camera is at the observer position (between      the two eyes!). I have added <span class="obeylines-h"><span class="verb">0.1*y</span></span> to its value later, so that the camera is      not blocked by the image or object beams cylinders, if these are present.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">look_at_image_true</span></span> &#x2013; Always keeps the center of the image in the center      of the picture.      </li>
<li class="itemize"><span class="obeylines-h"><span class="verb">orthographic_true</span></span> &#x2013; Uses orthographic viewing. Useful if looking down      at one of the axes. Actually, we are using a &#x2018;cheat&#x2019; orthographic view,      because true orthographic is not compatible with <span class="obeylines-h"><span class="verb">screen.inc</span></span> which we      need in order to put the data in the corner of the image. In our case we set a high value for the distance of the camera, and adjust the camera angle to      a very small one. If you are interested, see <span class="obeylines-h"><span class="verb">#if&nbsp;(orthographic_true)&#8230;</span></span>      in <span class="obeylines-h"><span class="verb">holpov.inc</span></span>.      </li>
</ul>
<p class="section-head">Multiple images</p>
<p>Quite often we want to superimpose in the same picture, the result of varying one of the values, for example, observer position, reconstruction wavelength, etc. I have defined a variable called <span class="obeylines-h"><span class="verb">repeat_image</span></span>. This can be set to a value which determines which parameter is to be varied. For example, we can say <span class="obeylines-h"><span class="verb">#declare&nbsp;repeat_image&nbsp;=&nbsp;Lambda_c</span></span> to vary the reconstruction wavelength. Note the upper case first letter to distinguish this &#x2018;choice&#x2019; from the actual value, which is <span class="obeylines-h"><span class="verb">lambda_c</span></span>. (I have previously set <span class="obeylines-h"><span class="verb">Lambda_c</span></span> to a number, so this is just a trick to make it easier to remember what is to be varied.) </p>
<p>In <span class="obeylines-h"><span class="verb">holopov.pov</span></span> I have inserted and commented out all the possible variables, so these just need to be uncommented. If nothing is to be varied, then we choose <span class="obeylines-h"><span class="verb">None</span></span>. </p>
<p>The value <span class="obeylines-h"><span class="verb">repeat_amplitude</span></span> determines the &#x2018;amplitude&#x2019; of the variation around the central value set previously. So, for example, if <span class="obeylines-h"><span class="verb">lambda_c</span></span> has been set to <span class="obeylines-h"><span class="verb">550</span></span>, and <span class="obeylines-h"><span class="verb">repeat_amplitude</span></span> is set to <span class="obeylines-h"><span class="verb">150</span></span>, then the range for repetition will be from 400 to 700nm. The number of steps is determined by <span class="obeylines-h"><span class="verb">number_of_steps</span></span>. A value of <span class="obeylines-h"><span class="verb">2</span></span> will result in two variations, one for 400 and one for 700nm. </p>
<p class="section-head">Animation</p>
<p>In addition to multiple images in the same output, we can animate the scene by varying any of these parameters. Using multiple images and animations are independent, so it is possible to have a multiple image that is animated too. For instance, we can show the effect of using different wavelengths to reconstruct in the same scene, using multiple images, then animate that whole scene by moving the observer in an arc, by varying <span class="obeylines-h"><span class="verb">obs_theta</span></span>. </p>
<p>The equivalent of <span class="obeylines-h"><span class="verb">repeat_amplitude</span></span> in animation is the <span class="obeylines-h"><span class="verb">animate</span></span> variable, and it is set in the same way as in multiple images. </p>
<p>There is one more parameter that determines how the frames are distributed through time: if <span class="obeylines-h"><span class="verb">sinusoidal_true</span></span> is set to zero, then the frames are evenly distributed through time. Otherwise, the distribution is sinusoidal. In other words, the variation is fast near the central value, and slows down towards the extreme values. When the final animation is &#x2018;looped back and forth&#x2019;, this gives a more natural, smooth motion. </p>
<p class="section-head">Running the animation</p>
<p>Please note that a command for running the animation must be given, otherwise the animation settings will be ignored. The precise method for running the animation depends on your installation. You should either choose animation through the user interface, or use a command line if you are using Linux or the command line version on Mac OS&nbsp;X (which is what I use). In any case, the most important point is that the <span class="obeylines-h"><span class="verb">clock</span></span> variable must go from <span class="obeylines-h"><span class="verb">-1</span></span> to <span class="obeylines-h"><span class="verb">1</span></span>. Other options, such as total number of frames, resolution, etc, are set according to your preference. </p>
<p>Of course <i>POV-ray</i> can only produce the individual frames for an animation. You will need to use a utility to convert these to a true movie file. I use QuickTime Pro, and it works pretty well. The best way to look at the animation is to loop the animation back and forth continuously. In QT&nbsp;Pro, choose &#x2018;loop back and forth&#x2019; from the Movie menu. </p>
<h3 style="font-size: 1.45em">Other comments</h3>
<p class="section-head">Data output</p>
<p>The reason for including <span class="obeylines-h"><span class="verb">screen.inc</span></span> is to allow data to be output to the file. This works very nicely. Presently only a few values are output, and there is no choice as to what to print. I need to spruce this up a bit. </p>
<p class="section-head">The maths</p>
<p>This was a bit more complex than I thought. The basic equations are those of Champagne of course, but there is a basic complication in display holography which                                                                                                                                        is not normally mentioned. In a conventional optical system, the &#x2018;pupil&#x2019; is normally given, and the principal ray is that which goes through the center of the pupil. So we can apply the equations and get the answer. In a display hologram, we don&#x2019;t know where the pupil will be. In other words, the precise spot on the hologram that the observer looks through is not fixed. If the wavelength is changed, the image will shift, and the observer will be looking through a different part of the hologram in order to see the same image point. The same happens of course if the observer moves. That point is the center of our optical system. </p>
<p>So before using the elegant equations of Champagne, I had to use an iterative method (Newton&#x2019;s approximation) to find the principal ray. Only then could I apply the equations. This process has to be repeated for each point in a grid.
<p> I will detail the mathematical background in another article soon. </p>
<p class="section-head">Divisions by zero</p>
<p>I have caught a few cases where division by zero occurs, e.g. when <span class="obeylines-h"><span class="verb">obj_dist&nbsp;=&nbsp;0</span></span>. In this case I use the simple trick of giving it a very small distance. (I think I am showing that I am not a <i>real</i> programmer!) I appreciate any more cases of such errors, as well as suggestions of better ways to avoid them. </p>
<p class="section-head">Lighting</p>
<p>This is set as a simple set of two lights, which can be changed.</p>
<h3 style="font-size: 1.45em">Things to do</h3>
<p class="section-head">Short term</p>
<ul class="itemize1">
<li class="itemize">Check angles for points in &#x2212;z region
     </li>
<li class="itemize">Group items better as macros in <span class="obeylines-h"><span class="verb">holopov.inc</span></span>
     </li>
<li class="itemize">Improve data display
     </li>
<li class="itemize">Provide option for a solid looking cube, rather like ball and sticks, as now.
     </li>
<li class="itemize">Provide a user-friendly GUI. It is important that this is portable, and<br />
     more or less device independent. I am presently trying out Revolution<br />
     (<a href="http://www.runrev.com" target="_blank">http://www.runrev.com</a>)
     </li>
</ul>
<p class="section-head">Longer term</p>
<ul class="itemize1">
<li class="itemize">Show a &#x2018;real&#x2019; object and its image, not just grid points or cubes
     </li>
<li class="itemize">Incorporate conventional optics (like a field lens) to modify image
     </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://holographer.org/holopov-a-previsualization-program-for-holographers-version-05/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

