<!-- This file copyright Persistence of Vision Raytracer Pty. Ltd. 2003-2004 --> <html> <head> <!-- NOTE: In order to users to help find information about POV-Ray using --> <!-- web search engines, we ask you to *not* let them index documentation --> <!-- mirrors because effectively, when searching, users will get hundreds --> <!-- of results containing the same information! For this reason, the two --> <!-- meta tags below disable archiving and indexing of this page by all --> <!-- search engines that support these meta tags. --> <meta content="noarchive" name="robots"> <meta content="noindex" name="robots"> <meta content="no-cache" http-equiv="Pragma"> <meta content="0" http-equiv="expires"> <title>3.2.1 Language Basics</title> <link href="povray35.css" rel="stylesheet" type="text/css"> </head> <body> <table class="NavBar" width="100%"> <tr> <td align="left" nowrap="" valign="middle" width="32"> <a href="s_96.html"><img alt="previous" border="0" src="prev.png"></a> </td> <td align="left" valign="middle" width="30%"> <a href="s_96.html">3.2 Scene Description Language</a> </td> <td align="center" valign="middle"> <strong class="NavBar">POV-Ray 3.6 for UNIX documentation</strong><br> <strong>3.2.1 Language Basics</strong> </td> <td align="right" valign="middle" width="30%"> <a href="s_98.html">3.2.2 Language Directives</a> </td> <td align="right" nowrap="" valign="middle" width="32"> <a href="s_98.html"><img alt="next" border="0" src="next.png"></a> </td> </tr> </table> <h3><a name="s03_02_01">3.2.1 </a>Language Basics</h3> <p> The POV-Ray language consists of identifiers, reserved keywords, floating point expressions, strings, special symbols and comments. The text of a POV-Ray scene file is free format. You may put statements on separate lines or on the same line as you desire. You may add blank lines, spaces or indentations as long as you do not split any keywords or identifiers. </p> <h4><a name="s03_02_01_01">3.2.1.1 </a>Identifiers and Keywords</h4> <a name="s03_02_01_01_i1"><a name="Identifiers"></a><a name="s03_02_01_01_i2"><a name="identifier"></a><a name="s03_02_01_01_i3"><a name="keywords"></a><a name="s03_02_01_01_i4"><a name="keyword"></a> <p> POV-Ray allows you to define identifiers for later use in the scene file. An identifier may be 1 to 40 characters long. It may consist of upper and lower case letters, the digits 0 through 9 or an underscore character ("_"). the first character must be an alphabetic character. The declaration of identifiers is covered later. </p> <p> POV-Ray has a number of reserved keywords which are listed below. </p> <table class="tablelist"> <tr> <th colspan="3">a</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_129.html#s03_06_02_02"><code>aa_level</code></a><br> <a href="s_129.html#s03_06_02_02"><code>aa_threshold</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>abs</code></a><br> <a href="#l58"><code>absorption</code></a><br> <a href="s_108.html#s03_04_04"><code>accuracy</code></a><br> <a href="#l59"><code>acos</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>acosh</code></a><br> <a href="s_111.html#s03_04_07_05"><code>adaptive</code></a><br> <a href="s_102.html#s03_03_03_01"><code>adc_bailout</code></a><br> <a href="s_125.html#s03_05_11_01"><code>agate</code></a><br> <a href="s_126.html#s03_05_12"><code>agate_turb</code></a><br> <a href="s_115.html#s03_05_01_05_02"><code>all</code></a><br> </td> <td width="33%"> <a href="s_108.html#s03_04_04"><code>all_intersections</code></a><br> <a href="s_115.html#s03_05_01_05_02"><code>alpha</code></a><br> <a href="s_125.html#s03_05_11_30"><code>altitude</code></a><br> <a href="s_103.html#s03_03_04_02_02"><code>always_sample</code></a><br> <a href="#l60"><code>ambient</code></a><br> <a href="s_102.html#s03_03_03_02"><code>ambient_light</code></a><br> <a href="#l61"><code>angle</code></a><br> <a href="s_100.html#s03_03_01_03"><code>aperture</code></a><br> <a href="s_98.html#s03_02_02_03_01"><code>append</code></a><br> <a href="s_101.html#s03_03_02_05"><code>arc_angle</code></a><br> <a href="s_111.html#s03_04_07_05"><code>area_light</code></a><br> <a href="#l62"><code>array</code></a><br> </td> <td width="33%"> <a href="s_97.html#s03_02_01_03_04"><code>asc</code></a><br> <a href="s_102.html#s03_03_03_06"><code>ascii</code></a><br> <a href="#l63"><code>asin</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>asinh</code></a><br> <a href="s_102.html#s03_03_03_03"><code>assumed_gamma</code></a><br> <a href="#l64"><code>atan</code></a><br> <a href="#l65"><code>atan2</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>atanh</code></a><br> <a href="#l66"><code>autostop</code></a><br> <a href="s_125.html#s03_05_11_02"><code>average</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">b</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_105.html#s03_04_01_10"><code>b_spline</code></a><br> <a href="#l67"><code>background</code></a><br> <a href="s_105.html#s03_04_01_07"><code>bezier_spline</code></a><br> <a href="s_106.html#s03_04_02_01"><code>bicubic_patch</code></a><br> <a href="s_126.html#s03_05_12_06_01"><code>black_hole</code></a><br> <a href="s_105.html#s03_04_01_01"><code>blob</code></a><br> <a href="s_97.html#s03_02_01_05_02"><code>blue</code></a><br> </td> <td width="33%"> <a href="s_100.html#s03_03_01_03"><code>blur_samples</code></a><br> <a href="s_113.html#s03_04_09_02"><code>bounded_by</code></a><br> <a href="s_105.html#s03_04_01_02"><code>box</code></a><br> <a href="s_125.html#s03_05_11_03"><code>boxed</code></a><br> <a href="s_125.html#s03_05_11_04"><code>bozo</code></a><br> <a href="s_98.html#s03_02_02_06_03"><code>break</code></a><br> <a href="s_125.html#s03_05_11_05"><code>brick</code></a><br> </td> <td width="33%"> <a href="s_126.html#s03_05_12"><code>brick_size</code></a><br> <a href="s_103.html#s03_03_04_02_03"><code>brightness</code></a><br> <a href="s_117.html#s03_05_03_02_02"><code>brilliance</code></a><br> <a href="s_116.html#s03_05_02_03"><code>bump_map</code></a><br> <a href="s_116.html#s03_05_02_03_02"><code>bump_size</code></a><br> <a href="s_125.html#s03_05_11_06"><code>bumps</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">c</th> </tr> <tr valign="top"> <td width="33%"> <a href="#l68"><code>camera</code></a><br> <a href="s_98.html#s03_02_02_06_03"><code>case</code></a><br> <a href="s_128.html#s03_06_01_07"><code>caustics</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>ceil</code></a><br> <a href="s_125.html#s03_05_11_07"><code>cells</code></a><br> <a href="s_102.html#s03_03_03_06"><code>charset</code></a><br> <a href="s_125.html#s03_05_11_08"><code>checker</code></a><br> <a href="s_97.html#s03_02_01_07_03"><code>chr</code></a><br> <a href="s_111.html#s03_04_07_05"><code>circular</code></a><br> <a href="s_113.html#s03_04_09_01"><code>clipped_by</code></a><br> <a href="s_97.html#s03_02_01_03_06"><code>clock</code></a><br> <a href="s_97.html#s03_02_01_03_06"><code>clock_delta</code></a><br> <a href="s_97.html#s03_02_01_03_06"><code>clock_on</code></a><br> <a href="s_130.html#s03_06_03_02_02"><code>collect</code></a><br> </td> <td width="33%"> <a href="#l69"><code>color</code></a><br> <a href="s_115.html#s03_05_01_03"><code>color_map</code></a><br> <a href="s_97.html#s03_02_01_05"><code>colour</code></a><br> <a href="s_115.html#s03_05_01_03"><code>colour_map</code></a><br> <a href="s_105.html#s03_04_01_01"><code>component</code></a><br> <a href="s_110.html#s03_04_06_02"><code>composite</code></a><br> <a href="s_97.html#s03_02_01_07_03"><code>concat</code></a><br> <a href="s_105.html#s03_04_01_03"><code>cone</code></a><br> <a href="s_100.html#s03_03_01_03"><code>confidence</code></a><br> <a href="s_105.html#s03_04_01_08"><code>conic_sweep</code></a><br> <a href="s_117.html#s03_05_03_05"><code>conserve_energy</code></a><br> <a href="s_108.html#s03_04_04"><code>contained_by</code></a><br> <a href="s_126.html#s03_05_12"><code>control0</code></a><br> <a href="s_126.html#s03_05_12"><code>control1</code></a><br> </td> <td width="33%"> <a href="s_125.html#s03_05_11_13"><code>coords</code></a><br> <a href="#l70"><code>cos</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>cosh</code></a><br> <a href="s_103.html#s03_03_04_02_04"><code>count</code></a><br> <a href="s_125.html#s03_05_11_09"><code>crackle</code></a><br> <a href="s_117.html#s03_05_03_02_03"><code>crand</code></a><br> <a href="s_105.html#s03_04_01_06"><code>cube</code></a><br> <a href="s_107.html#s03_04_03_02"><code>cubic</code></a><br> <a href="s_105.html#s03_04_01_07"><code>cubic_spline</code></a><br> <a href="s_126.html#s03_05_12"><code>cubic_wave</code></a><br> <a href="s_124.html#s03_05_10"><code>cutaway_textures</code></a><br> <a href="s_105.html#s03_04_01_04"><code>cylinder</code></a><br> <a href="s_125.html#s03_05_11_10"><code>cylindrical</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">d</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_98.html#s03_02_02_07_01"><code>debug</code></a><br> <a href="s_98.html#s03_02_02_02_01"><code>declare</code></a><br> <a href="s_98.html#s03_02_02_04"><code>default</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>defined</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>degrees</code></a><br> <a href="s_129.html#s03_06_02_03"><code>density</code></a><br> <a href="s_125.html#s03_05_11_11"><code>density_file</code></a><br> <a href="s_129.html#s03_06_02_03_03"><code>density_map</code></a><br> </td> <td width="33%"> <a href="s_125.html#s03_05_11_12"><code>dents</code></a><br> <a href="s_125.html#s03_05_11_11"><code>df3</code></a><br> <a href="s_110.html#s03_04_06_04"><code>difference</code></a><br> <a href="s_117.html#s03_05_03_02_01"><code>diffuse</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>dimension_size</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>dimensions</code></a><br> <a href="s_100.html#s03_03_01_01_04"><code>direction</code></a><br> <a href="s_106.html#s03_04_02_02"><code>disc</code></a><br> </td> <td width="33%"> <a href="s_128.html#s03_06_01_05"><code>dispersion</code></a><br> <a href="s_128.html#s03_06_01_05"><code>dispersion_samples</code></a><br> <a href="s_126.html#s03_05_12_06_05"><code>dist_exp</code></a><br> <a href="s_101.html#s03_03_02_03"><code>distance</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>div</code></a><br> <a href="s_113.html#s03_04_09_08"><code>double_illuminate</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">e</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_129.html#s03_06_02_01_03"><code>eccentricity</code></a><br> <a href="s_98.html#s03_02_02_06_01"><code>else</code></a><br> <a href="s_129.html#s03_06_02_01_02"><code>emission</code></a><br> <a href="s_98.html#s03_02_02_06_01"><code>end</code></a><br> </td> <td width="33%"> <a href="s_98.html#s03_02_02_07_01"><code>error</code></a><br> <a href="#l71"><code>error_bound</code></a><br> <a href="s_108.html#s03_04_04"><code>evaluate</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>exp</code></a><br> </td> <td width="33%"> <a href="s_130.html#s03_06_03_05_02"><code>expand_thresholds</code></a><br> <a href="s_117.html#s03_05_03_04"><code>exponent</code></a><br> <a href="s_125.html#s03_05_11_14"><code>exterior</code></a><br> <a href="s_129.html#s03_06_02_01_03"><code>extinction</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">f</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_106.html#s03_04_02_04"><code>face_indices</code></a><br> <a href="s_125.html#s03_05_11_13"><code>facets</code></a><br> <a href="s_128.html#s03_06_01_06"><code>fade_color</code></a><br> <a href="s_128.html#s03_06_01_06"><code>fade_colour</code></a><br> <a href="s_111.html#s03_04_07_09"><code>fade_distance</code></a><br> <a href="s_111.html#s03_04_07_09"><code>fade_power</code></a><br> <a href="s_111.html#s03_04_07_02"><code>falloff</code></a><br> <a href="s_101.html#s03_03_02_05"><code>falloff_angle</code></a><br> <a href="s_97.html#s03_02_01_03_05"><code>false</code></a><br> <a href="s_98.html#s03_02_02_03_02"><code>fclose</code></a><br> </td> <td width="33%"> <a href="s_97.html#s03_02_01_03_04"><code>file_exists</code></a><br> <a href="s_97.html#s03_02_01_05"><code>filter</code></a><br> <a href="s_97.html#s03_02_01_03_06"><code>final_clock</code></a><br> <a href="s_97.html#s03_02_01_03_06"><code>final_frame</code></a><br> <a href="#l72"><code>finish</code></a><br> <a href="s_100.html#s03_03_01_02_03"><code>fisheye</code></a><br> <a href="s_106.html#s03_04_02_01"><code>flatness</code></a><br> <a href="s_126.html#s03_05_12_06_02"><code>flip</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>floor</code></a><br> <a href="s_100.html#s03_03_01_03"><code>focal_point</code></a><br> </td> <td width="33%"> <a href="#l73"><code>fog</code></a><br> <a href="s_101.html#s03_03_02_03"><code>fog_alt</code></a><br> <a href="s_101.html#s03_03_02_03"><code>fog_offset</code></a><br> <a href="s_101.html#s03_03_02_03"><code>fog_type</code></a><br> <a href="s_98.html#s03_02_02_03_01"><code>fopen</code></a><br> <a href="s_125.html#s03_05_11_09"><code>form</code></a><br> <a href="s_97.html#s03_02_01_03_06"><code>frame_number</code></a><br> <a href="s_126.html#s03_05_12"><code>frequency</code></a><br> <a href="s_117.html#s03_05_03_04"><code>fresnel</code></a><br> <a href="#l74"><code>function</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">g</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_130.html#s03_06_03_02_01"><code>gather</code></a><br> <a href="s_115.html#s03_05_01_05_01"><code>gif</code></a><br> <a href="s_112.html#s03_04_08"><code>global_lights</code></a><br> </td> <td width="33%"> <a href="#l75"><code>global_settings</code></a><br> <a href="#l76"><code>gradient</code></a><br> <a href="s_125.html#s03_05_11_18"><code>granite</code></a><br> </td> <td width="33%"> <a href="s_97.html#s03_02_01_05_04"><code>gray</code></a><br> <a href="s_103.html#s03_03_04_02_06"><code>gray_threshold</code></a><br> <a href="s_97.html#s03_02_01_05_02"><code>green</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">h</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_105.html#s03_04_01_05"><code>height_field</code></a><br> <a href="s_125.html#s03_05_11_19"><code>hexagon</code></a><br> </td> <td width="33%"> <a href="s_102.html#s03_03_03_04"><code>hf_gray_16</code></a><br> <a href="s_105.html#s03_04_01_01"><code>hierarchy</code></a><br> </td> <td width="33%"> <a href="s_105.html#s03_04_01_06"><code>hypercomplex</code></a><br> <a href="s_113.html#s03_04_09_05"><code>hollow</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">i</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_98.html#s03_02_02_06_01"><code>if</code></a><br> <a href="s_98.html#s03_02_02_06_02"><code>ifdef</code></a><br> <a href="s_115.html#s03_05_01_05_01"><code>iff</code></a><br> <a href="s_98.html#s03_02_02_06_02"><code>ifndef</code></a><br> <a href="s_97.html#s03_02_01_03_06"><code>image_height</code></a><br> <a href="s_115.html#s03_05_01_05"><code>image_map</code></a><br> <a href="s_125.html#s03_05_11_20"><code>image_pattern</code></a><br> <a href="s_97.html#s03_02_01_03_06"><code>image_width</code></a><br> <a href="s_98.html#s03_02_02_01"><code>include</code></a><br> </td> <td width="33%"> <a href="s_97.html#s03_02_01_03_06"><code>initial_clock</code></a><br> <a href="s_97.html#s03_02_01_03_06"><code>initial_frame</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>inside</code></a><br> <a href="s_106.html#s03_04_02_03_01"><code>inside_vector</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>int</code></a><br> <a href="#l77"><code>interior</code></a><br> <a href="#l78"><code>interior_texture</code></a><br> <a href="s_97.html#s03_02_01_06_06"><code>internal</code></a><br> <a href="s_126.html#s03_05_12"><code>interpolate</code></a><br> </td> <td width="33%"> <a href="s_110.html#s03_04_06_03"><code>intersection</code></a><br> <a href="s_129.html#s03_06_02_02"><code>intervals</code></a><br> <a href="s_113.html#s03_04_09_04"><code>inverse</code></a><br> <a href="#l79"><code>ior</code></a><br> <a href="s_117.html#s03_05_03_06"><code>irid</code></a><br> <a href="s_102.html#s03_03_03_05"><code>irid_wavelength</code></a><br> <a href="#l80"><code>isosurface</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">j</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_111.html#s03_04_07_05"><code>jitter</code></a><br> <a href="s_115.html#s03_05_01_05_01"><code>jpeg</code></a><br> </td> <td width="33%"> <a href="s_125.html#s03_05_11_14"><code>julia</code></a><br> <a href="s_105.html#s03_04_01_06"><code>julia_fractal</code></a><br> </td> <td width="33%"> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">l</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_126.html#s03_05_12"><code>lambda</code></a><br> <a href="s_105.html#s03_04_01_07"><code>lathe</code></a><br> <a href="s_125.html#s03_05_11_21"><code>leopard</code></a><br> <a href="s_112.html#s03_04_08"><code>light_group</code></a><br> <a href="s_111.html#s03_04_07"><code>light_source</code></a><br> </td> <td width="33%"> <a href="s_105.html#s03_04_01_07"><code>linear_spline</code></a><br> <a href="s_105.html#s03_04_01_08"><code>linear_sweep</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>ln</code></a><br> <a href="s_103.html#s03_03_04_02_15"><code>load_file</code></a><br> <a href="s_98.html#s03_02_02_02"><code>local</code></a><br> </td> <td width="33%"> <a href="s_100.html#s03_03_01_01_01"><code>location</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>log</code></a><br> <a href="s_100.html#s03_03_01_01_01"><code>look_at</code></a><br> <a href="s_111.html#s03_04_07_07"><code>looks_like</code></a><br> <a href="s_103.html#s03_03_04_02_07"><code>low_error_factor</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">m</th> </tr> <tr valign="top"> <td width="33%"> <a href="#l81"><code>macro</code></a><br> <a href="s_125.html#s03_05_11_14"><code>magnet</code></a><br> <a href="s_126.html#s03_05_12_06_05"><code>major_radius</code></a><br> <a href="s_125.html#s03_05_11_14"><code>mandel</code></a><br> <a href="s_126.html#s03_05_12_07_02"><code>map_type</code></a><br> <a href="s_125.html#s03_05_11_22"><code>marble</code></a><br> <a href="#l82"><code>material</code></a><br> <a href="s_119.html#s03_05_05_03"><code>material_map</code></a><br> <a href="#l83"><code>matrix</code></a><br> <a href="#l84"><code>max</code></a><br> <a href="s_97.html#s03_02_01_04_05"><code>max_extent</code></a><br> </td> <td width="33%"> <a href="s_108.html#s03_04_04"><code>max_gradient</code></a><br> <a href="s_102.html#s03_03_03_08"><code>max_intersections</code></a><br> <a href="s_105.html#s03_04_01_06"><code>max_iteration</code></a><br> <a href="s_103.html#s03_03_04_02_08"><code>max_sample</code></a><br> <a href="s_108.html#s03_04_04"><code>max_trace</code></a><br> <a href="s_102.html#s03_03_03_07"><code>max_trace_level</code></a><br> <a href="#l85"><code>media</code></a><br> <a href="s_111.html#s03_04_07_11"><code>media_attenuation</code></a><br> <a href="s_111.html#s03_04_07_10"><code>media_interaction</code></a><br> <a href="s_110.html#s03_04_06_05"><code>merge</code></a><br> <a href="#l86"><code>mesh</code></a><br> </td> <td width="33%"> <a href="s_106.html#s03_04_02_04"><code>mesh2</code></a><br> <a href="s_117.html#s03_05_03_03_03"><code>metallic</code></a><br> <a href="s_129.html#s03_06_02_02"><code>method</code></a><br> <a href="s_125.html#s03_05_11_09"><code>metric</code></a><br> <a href="#l87"><code>min</code></a><br> <a href="s_97.html#s03_02_01_04_05"><code>min_extent</code></a><br> <a href="s_103.html#s03_03_04_02_10"><code>minimum_reuse</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>mod</code></a><br> <a href="s_126.html#s03_05_12"><code>mortar</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">n</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_97.html#s03_02_01_09"><code>natural_spline</code></a><br> <a href="s_103.html#s03_03_04_02_11"><code>nearest_count</code></a><br> <a href="s_97.html#s03_02_01_03_05"><code>no</code></a><br> <a href="s_116.html#s03_05_02_04"><code>no_bump_scale</code></a><br> <a href="s_113.html#s03_04_09_07"><code>no_image</code></a><br> </td> <td width="33%"> <a href="s_113.html#s03_04_09_07"><code>no_reflection</code></a><br> <a href="s_113.html#s03_04_09_06"><code>no_shadow</code></a><br> <a href="#l88"><code>noise_generator</code></a><br> <a href="#l89"><code>normal</code></a><br> <a href="s_106.html#s03_04_02_04"><code>normal_indices</code></a><br> </td> <td width="33%"> <a href="s_116.html#s03_05_02_02"><code>normal_map</code></a><br> <a href="s_106.html#s03_04_02_04"><code>normal_vectors</code></a><br> <a href="s_102.html#s03_03_03_09"><code>number_of_waves</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">o</th> </tr> <tr valign="top"> <td width="33%"> <a href="#l90"><code>object</code></a><br> <a href="s_126.html#s03_05_12"><code>octaves</code></a><br> <a href="s_97.html#s03_02_01_03_05"><code>off</code></a><br> <a href="s_126.html#s03_05_12_06_02"><code>offset</code></a><br> <a href="s_126.html#s03_05_12"><code>omega</code></a><br> </td> <td width="33%"> <a href="s_100.html#s03_03_01_02_05"><code>omnimax</code></a><br> <a href="s_97.html#s03_02_01_03_05"><code>on</code></a><br> <a href="s_126.html#s03_05_12_07_01"><code>once</code></a><br> <a href="s_125.html#s03_05_11_24"><code>onion</code></a><br> <a href="#l91"><code>open</code></a><br> </td> <td width="33%"> <a href="s_111.html#s03_04_07_05"><code>orient</code></a><br> <a href="s_126.html#s03_05_12_06_05"><code>orientation</code></a><br> <a href="s_100.html#s03_03_01_02_02"><code>orthographic</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">p</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_100.html#s03_03_01_02_06"><code>panoramic</code></a><br> <a href="s_111.html#s03_04_07_04"><code>parallel</code></a><br> <a href="#l92"><code>parametric</code></a><br> <a href="s_130.html#s03_06_03_02_02"><code>pass_through</code></a><br> <a href="#l93"><code>pattern</code></a><br> <a href="s_100.html#s03_03_01_02_01"><code>perspective</code></a><br> <a href="s_115.html#s03_05_01_05_01"><code>pgm</code></a><br> <a href="s_126.html#s03_05_12"><code>phase</code></a><br> <a href="s_117.html#s03_05_03_03_01"><code>phong</code></a><br> <a href="s_117.html#s03_05_03_03_01"><code>phong_size</code></a><br> <a href="#l94"><code>photons</code></a><br> </td> <td width="33%"> <a href="s_97.html#s03_02_01_03_05"><code>pi</code></a><br> <a href="#l95"><code>pigment</code></a><br> <a href="s_115.html#s03_05_01_04"><code>pigment_map</code></a><br> <a href="s_125.html#s03_05_11_25"><code>pigment_pattern</code></a><br> <a href="s_125.html#s03_05_11_26"><code>planar</code></a><br> <a href="s_107.html#s03_04_03_01"><code>plane</code></a><br> <a href="s_115.html#s03_05_01_05_01"><code>png</code></a><br> <a href="s_111.html#s03_04_07_02"><code>point_at</code></a><br> <a href="s_107.html#s03_04_03_02"><code>poly</code></a><br> <a href="s_126.html#s03_05_12"><code>poly_wave</code></a><br> <a href="s_106.html#s03_04_02_05"><code>polygon</code></a><br> </td> <td width="33%"> <a href="s_105.html#s03_04_01_05"><code>pot</code></a><br> <a href="#l96"><code>pow</code></a><br> <a href="s_115.html#s03_05_01_05_01"><code>ppm</code></a><br> <a href="s_105.html#s03_04_01_06"><code>precision</code></a><br> <a href="s_109.html#s03_04_05"><code>precompute</code></a><br> <a href="s_103.html#s03_03_04_02_13"><code>pretrace_end</code></a><br> <a href="s_103.html#s03_03_04_02_13"><code>pretrace_start</code></a><br> <a href="s_105.html#s03_04_01_08"><code>prism</code></a><br> <a href="s_97.html#s03_02_01_06_01"><code>prod</code></a><br> <a href="s_111.html#s03_04_07_08"><code>projected_through</code></a><br> <a href="s_105.html#s03_04_01_06"><code>pwr</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">q</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_105.html#s03_04_01_07"><code>quadratic_spline</code></a><br> <a href="s_107.html#s03_04_03_03"><code>quadric</code></a><br> <a href="s_107.html#s03_04_03_02"><code>quartic</code></a><br> </td> <td width="33%"> <a href="s_105.html#s03_04_01_06"><code>quaternion</code></a><br> <a href="s_115.html#s03_05_01_06"><code>quick_color</code></a><br> <a href="s_115.html#s03_05_01_06"><code>quick_colour</code></a><br> </td> <td width="33%"> <a href="s_125.html#s03_05_11_27"><code>quilted</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">r</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_125.html#s03_05_11_28"><code>radial</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>radians</code></a><br> <a href="#l97"><code>radiosity</code></a><br> <a href="s_111.html#s03_04_07_02"><code>radius</code></a><br> <a href="#l98"><code>rainbow</code></a><br> <a href="s_126.html#s03_05_12"><code>ramp_wave</code></a><br> <a href="#l99"><code>rand</code></a><br> <a href="s_98.html#s03_02_02_06_03"><code>range</code></a><br> <a href="s_129.html#s03_06_02_02"><code>ratio</code></a><br> </td> <td width="33%"> <a href="s_98.html#s03_02_02_03_03"><code>read</code></a><br> <a href="s_105.html#s03_04_01_06"><code>reciprocal</code></a><br> <a href="s_103.html#s03_03_04_02_14"><code>recursion_limit</code></a><br> <a href="s_97.html#s03_02_01_05_02"><code>red</code></a><br> <a href="s_117.html#s03_05_03_04"><code>reflection</code></a><br> <a href="s_117.html#s03_05_03_04"><code>reflection_exponent</code></a><br> <a href="#l100"><code>refraction</code></a><br> <a href="s_98.html#s03_02_02_07_01"><code>render</code></a><br> <a href="s_126.html#s03_05_12_06_02"><code>repeat</code></a><br> </td> <td width="33%"> <a href="s_97.html#s03_02_01_05_01"><code>rgb</code></a><br> <a href="s_97.html#s03_02_01_05_01"><code>rgbf</code></a><br> <a href="s_97.html#s03_02_01_05_01"><code>rgbft</code></a><br> <a href="s_97.html#s03_02_01_05_01"><code>rgbt</code></a><br> <a href="s_100.html#s03_03_01_01_05"><code>right</code></a><br> <a href="s_125.html#s03_05_11_29"><code>ripples</code></a><br> <a href="#l101"><code>rotate</code></a><br> <a href="s_117.html#s03_05_03_03_02"><code>roughness</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">s</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_129.html#s03_06_02_02"><code>samples</code></a><br> <a href="s_103.html#s03_03_04_02_15"><code>save_file</code></a><br> <a href="#l102"><code>scale</code></a><br> <a href="s_126.html#s03_05_12"><code>scallop_wave</code></a><br> <a href="s_129.html#s03_06_02_01_03"><code>scattering</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>seed</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>select</code></a><br> <a href="s_111.html#s03_04_07_06"><code>shadowless</code></a><br> <a href="#l103"><code>sin</code></a><br> <a href="s_126.html#s03_05_12"><code>sine_wave</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>sinh</code></a><br> <a href="s_125.html#s03_05_11_13"><code>size</code></a><br> <a href="s_100.html#s03_03_01_01_02"><code>sky</code></a><br> <a href="#l104"><code>sky_sphere</code></a><br> <a href="s_105.html#s03_04_01_06"><code>slice</code></a><br> <a href="s_125.html#s03_05_11_30"><code>slope</code></a><br> </td> <td width="33%"> <a href="s_116.html#s03_05_02_01"><code>slope_map</code></a><br> <a href="s_105.html#s03_04_01_05"><code>smooth</code></a><br> <a href="s_106.html#s03_04_02_06"><code>smooth_triangle</code></a><br> <a href="s_125.html#s03_05_11_09"><code>solid</code></a><br> <a href="s_105.html#s03_04_01_12"><code>sor</code></a><br> <a href="s_130.html#s03_06_03_02_01"><code>spacing</code></a><br> <a href="s_117.html#s03_05_03_03_02"><code>specular</code></a><br> <a href="s_105.html#s03_04_01_09"><code>sphere</code></a><br> <a href="s_105.html#s03_04_01_10"><code>sphere_sweep</code></a><br> <a href="s_125.html#s03_05_11_31"><code>spherical</code></a><br> <a href="s_125.html#s03_05_11_32"><code>spiral1</code></a><br> <a href="s_125.html#s03_05_11_33"><code>spiral2</code></a><br> <a href="#l105"><code>spline</code></a><br> <a href="s_110.html#s03_04_06_02_01"><code>split_union</code></a><br> <a href="s_111.html#s03_04_07_02"><code>spotlight</code></a><br> <a href="s_125.html#s03_05_11_34"><code>spotted</code></a><br> </td> <td width="33%"> <a href="#l106"><code>sqr</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>sqrt</code></a><br> <a href="s_98.html#s03_02_02_07_01"><code>statistics</code></a><br> <a href="s_97.html#s03_02_01_07_03"><code>str</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>strcmp</code></a><br> <a href="s_105.html#s03_04_01_01"><code>strength</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>strlen</code></a><br> <a href="s_97.html#s03_02_01_07_03"><code>strlwr</code></a><br> <a href="s_97.html#s03_02_01_07_03"><code>strupr</code></a><br> <a href="s_113.html#s03_04_09_09"><code>sturm</code></a><br> <a href="s_97.html#s03_02_01_07_03"><code>substr</code></a><br> <a href="s_97.html#s03_02_01_06_01"><code>sum</code></a><br> <a href="s_105.html#s03_04_01_11"><code>superellipsoid</code></a><br> <a href="s_98.html#s03_02_02_06_03"><code>switch</code></a><br> <a href="s_102.html#s03_03_03_06"><code>sys</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">t</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_97.html#s03_02_01_04_03"><code>t</code></a><br> <a href="#l107"><code>tan</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>tanh</code></a><br> <a href="s_130.html#s03_06_03_02_02"><code>target</code></a><br> <a href="s_105.html#s03_04_01_13"><code>text</code></a><br> <a href="#l108"><code>texture</code></a><br> <a href="#l109"><code>texture_list</code></a><br> <a href="s_119.html#s03_05_05_01"><code>texture_map</code></a><br> <a href="s_115.html#s03_05_01_05_01"><code>tga</code></a><br> <a href="s_117.html#s03_05_03_06"><code>thickness</code></a><br> </td> <td width="33%"> <a href="s_105.html#s03_04_01_01"><code>threshold</code></a><br> <a href="s_115.html#s03_05_01_05_01"><code>tiff</code></a><br> <a href="s_111.html#s03_04_07_02"><code>tightness</code></a><br> <a href="s_119.html#s03_05_05_02"><code>tile2</code></a><br> <a href="s_119.html#s03_05_05_02"><code>tiles</code></a><br> <a href="s_105.html#s03_04_01_10"><code>tolerance</code></a><br> <a href="s_126.html#s03_05_12_06_05"><code>toroidal</code></a><br> <a href="s_105.html#s03_04_01_14"><code>torus</code></a><br> <a href="s_97.html#s03_02_01_04_05"><code>trace</code></a><br> <a href="#l110"><code>transform</code></a><br> </td> <td width="33%"> <a href="#l111"><code>translate</code></a><br> <a href="s_97.html#s03_02_01_05"><code>transmit</code></a><br> <a href="s_106.html#s03_04_02_06"><code>triangle</code></a><br> <a href="s_126.html#s03_05_12"><code>triangle_wave</code></a><br> <a href="s_97.html#s03_02_01_03_05"><code>true</code></a><br> <a href="s_105.html#s03_04_01_13"><code>ttf</code></a><br> <a href="s_101.html#s03_03_02_03"><code>turb_depth</code></a><br> <a href="#l112"><code>turbulence</code></a><br> <a href="s_106.html#s03_04_02_01"><code>type</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">u</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_97.html#s03_02_01_04_03"><code>u</code></a><br> <a href="s_106.html#s03_04_02_01"><code>u_steps</code></a><br> <a href="s_100.html#s03_03_01_02_04"><code>ultra_wide_angle</code></a><br> <a href="s_98.html#s03_02_02_02_04"><code>undef</code></a><br> <a href="s_110.html#s03_04_06_02"><code>union</code></a><br> </td> <td width="33%"> <a href="s_100.html#s03_03_01_01_05"><code>up</code></a><br> <a href="s_125.html#s03_05_11_20"><code>use_alpha</code></a><br> <a href="s_116.html#s03_05_02_03_03"><code>use_color</code></a><br> <a href="s_116.html#s03_05_02_03_03"><code>use_colour</code></a><br> <a href="s_116.html#s03_05_02_03_03"><code>use_index</code></a><br> </td> <td width="33%"> <a href="s_102.html#s03_03_03_06"><code>utf8</code></a><br> <a href="s_106.html#s03_04_02_04"><code>uv_indices</code></a><br> <a href="#l113"><code>uv_mapping</code></a><br> <a href="#l114"><code>uv_vectors</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">v</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_97.html#s03_02_01_04_03"><code>v</code></a><br> <a href="s_106.html#s03_04_02_01"><code>v_steps</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>val</code></a><br> <a href="s_100.html#s03_03_01_03"><code>variance</code></a><br> <a href="s_97.html#s03_02_01_04_05"><code>vaxis_rotate</code></a><br> </td> <td width="33%"> <a href="s_97.html#s03_02_01_04_05"><code>vcross</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>vdot</code></a><br> <a href="s_98.html#s03_02_02_05"><code>version</code></a><br> <a href="s_106.html#s03_04_02_04"><code>vertex_vectors</code></a><br> <a href="s_97.html#s03_02_01_03_04"><code>vlength</code></a><br> </td> <td width="33%"> <a href="s_97.html#s03_02_01_04_05"><code>vnormalize</code></a><br> <a href="s_97.html#s03_02_01_04_05"><code>vrotate</code></a><br> <a href="s_97.html#s03_02_01_07_03"><code>vstr</code></a><br> <a href="s_97.html#s03_02_01_04_05"><code>vturbulence</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">w</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_98.html#s03_02_02_07_01"><code>warning</code></a><br> <a href="#l115"><code>warp</code></a><br> <a href="s_105.html#s03_04_01_05"><code>water_level</code></a><br> </td> <td width="33%"> <a href="s_125.html#s03_05_11_35"><code>waves</code></a><br> <a href="s_98.html#s03_02_02_06_04"><code>while</code></a><br> <a href="s_101.html#s03_03_02_05"><code>width</code></a><br> </td> <td width="33%"> <a href="#l116"><code>wood</code></a><br> <a href="s_125.html#s03_05_11_37"><code>wrinkles</code></a><br> <a href="s_98.html#s03_02_02_03_04"><code>write</code></a><br> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">x</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_97.html#s03_02_01_04_03"><code>x</code></a><br> </td> <td width="33%"> </td> <td width="33%"> </td> </tr> </table> <table class="tablelist"> <tr valign="top"> <th align="left" colspan="3">y</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_97.html#s03_02_01_04_03"><code>y</code></a><br> </td> <td width="33%"> <a href="s_97.html#s03_02_01_03_05"><code>yes</code></a><br> </td> <td width="33%"> </td> </tr> </table> <table class="tablelist" summary="All reserved keywords"> <tr valign="top"> <th align="left" colspan="3">z</th> </tr> <tr valign="top"> <td width="33%"> <a href="s_97.html#s03_02_01_04_03"><code>z</code></a><br> </td> <td width="33%"> </td> <td width="33%"> </td> </tr> </table> <p> All reserved words are fully lower case. Therefore it is recommended that your identifiers contain at least one upper case character so it is sure to avoid conflict with reserved words. </p> <h4><a name="s03_02_01_02">3.2.1.2 </a>Comments</h4> <a name="s03_02_01_02_i1"><a name="comment"></a> <p> Comments are text in the scene file included to make the scene file easier to read or understand. They are ignored by the ray-tracer and are there for your information. There are two types of comments in POV-Ray. </p> <p> Two slashes are used for single line comments. Anything on a line after a double slash (<code>//</code>) is ignored by the ray-tracer. For example: </p> <pre> // This line is ignored </pre> <p> You can have scene file information on the line in front of the comment as in: </p> <pre> object { FooBar } // this is an object </pre> <p> The other type of comment is used for multiple lines. It starts with "<code>/*</code>" and ends with "<code>*/</code>". Everything in-between is ignored. For example: </p> <pre> /* These lines are ignored by the ray-tracer */ </pre> <p> This can be useful if you want to temporarily remove elements from a scene file. <code>/*</code> ... <code>*/</code> comments can <em>comment out</em> lines containing other <code>//</code> comments and thus can be used to temporarily or permanently comment out parts of a scene. <code> /*</code> ... <code>*/</code> comments can be nested, the following is legal: </p> <pre> /* This is a comment // This too /* This also */ */ </pre> <p> Use comments liberally and generously. Well used, they really improve the readability of scene files. </p> <h4><a name="s03_02_01_03">3.2.1.3 </a>Float Expressions</h4> <a name="s03_02_01_03_i1"><a name="s03_02_01_03_i2"> <p> Many parts of the POV-Ray language require you to specify one or more floating point numbers. A floating point number is a number with a decimal point. Floats may be specified using literals, identifiers or functions which return float values. You may also create very complex float expressions from combinations of any of these using various familiar operators. </p> <p> Where POV-Ray needs an integer value it allows you to specify a float value and it truncates it to an integer. When POV-Ray needs a logical or boolean value it interprets any non-zero float as true and zero as false. Because float comparisons are subject to rounding errors POV-Ray accepts values extremely close to zero as being false when doing boolean functions. Typically values whose absolute values are less than a preset value <em> epsilon</em> are considered false for logical expressions. The value of <em> epsilon</em> is system dependent but is generally about 1.0e-10. Two floats <em>a</em> and <em>b</em> are considered to be equal if <em>abs(a-b) < epsilon.</em> </p> <p> The full syntax for float expressions is given below. Detailed explanations are given in the following sub-sections. </p> <pre> FLOAT: NUMERIC_TERM [SIGN NUMERIC_TERM]... SIGN: + | - NUMERIC_TERM: NUMERIC_FACTOR [MULT NUMERIC_FACTOR]... MULT: * | / NUMERIC_FACTOR: FLOAT_LITERAL | FLOAT_IDENTIFIER | SIGN NUMERIC_FACTOR | FLOAT_FUNCTION | FLOAT_BUILT-IN_IDENT | ( FULL_EXPRESSION ) | ! NUMERIC_FACTOR VECTOR DECIMAL_POINT DOT_ITEM FLOAT_LITERAL: [DIGIT...] [DECIMAL_POINT] DIGIT... [EXP [SIGN] DIGIT...] DIGIT: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 DECIMAL_POINT: . EXP: e | E DOT_ITEM: x | y | z | t | u | v | red | blue | green | filter | transmit | gray FLOAT_FUNCTION: abs( FLOAT ) | acos( FLOAT ) | acosh( FLOAT ) | asc( STRING ) | asin( FLOAT ) | asinh( FLOAT ) | atan( FLOAT) | atanh( FLOAT) | atan2( FLOAT , FLOAT ) | ceil( FLOAT ) | cos( FLOAT ) | cosh( FLOAT ) | defined(IDENTIFIER ) | degrees( FLOAT ) | dimensions( ARRAY_IDENTIFIER ) | dimension_size( ARRAY_IDENTIFIER , FLOAT ) | div( FLOAT , FLOAT ) | exp( FLOAT ) | file_exists( STRING ) | floor( FLOAT ) | int( FLOAT ) | ln(Float | log( FLOAT ) | max( FLOAT , FLOAT, ... ) | min( FLOAT , FLOAT, ... ) | mod( FLOAT , FLOAT ) | pow( FLOAT , FLOAT ) | radians( FLOAT ) | rand( FLOAT ) | seed( FLOAT ) | select( FLOAT, FLOAT, FLOAT [,FLOAT]) | sin( FLOAT ) | sinh( FLOAT ) | sqrt( FLOAT ) | strcmp( STRING , STRING ) | strlen( STRING ) | tan( FLOAT ) | tanh( FLOAT ) | val( STRING ) | vdot( VECTOR , VECTOR ) | vlength( VECTOR ) | FLOAT_BUILT-IN_IDENT: clock | clock_delta | clock_on | false | final_clock | final_frame | frame_number | initial_clock | initial_frame | image_width | image_height | no | off | on | pi | true | version | yes | FULL_EXPRESSION: LOGICAL_EXPRESSION [? FULL_EXPRESSION : FULL_EXPRESSION] LOGICAL_EXPRESSION: REL_TERM [LOGICAL_OPERATOR REL_TERM]... LOGICAL_OPERATOR: & | | (note: this means an ampersand or a vertical bar is a logical operator) REL_TERM: FLOAT [REL_OPERATOR FLOAT]... REL_OPERATOR: < | <= | = | >= | > | != INT: FLOAT (note: any syntax which requires a integer INT will accept a FLOAT and it will be truncated to an integer internally by POV-Ray). </pre> <p class="Note"> <strong>Note:</strong> <em>FLOAT_IDENTIFIERS</em> are identifiers previously declared to have float values. The <em>DOT_ITEM</em> syntax is actually a vector or color operator but it returns a float value. See "<a href="s_97.html#s03_02_01_04_03">Vector Operators</a>" or "Color Operators" for details. An <em> ARRAY_IDENTIFIER</em> is just the identifier name of a previously declared array, it does not include the <code>[]</code> braces nor the index. The syntax for <em>STRING</em> is in the section "<a href="#l117">Strings</a>". </p> <h5><a name="s03_02_01_03_01">3.2.1.3.1 </a>Literals</h5> <a name="s03_02_01_03_01_i1"><a name="s03_02_01_03_01_i2"> <p> Float literals are represented by an optional sign ("+" or "-") digits, an optional decimal point and more digits. If the number is an integer you may omit the decimal point and trailing zero. If it is all fractional you may omit the leading zero. POV-Ray supports scientific notation for very large or very small numbers. The following are all valid float literals: </p> <p> <code> -2.0 -4 34 3.4e6 2e-5 .3 0.6</code> </p> <h5><a name="s03_02_01_03_02">3.2.1.3.2 </a>Identifiers</h5> <a name="s03_02_01_03_02_i1"><a name="Identifiers, float"></a><a name="s03_02_01_03_02_i2"><a name="Float, identifiers"></a> <p> Float identifiers may be declared to make scene files more readable and to parameterize scenes so that changing a single declaration changes many values. An identifier is declared as follows. </p> <pre> FLOAT_DECLARATION: #declare IDENTIFIER = EXPRESSION; | #local IDENTIFIER = EXPRESSION; </pre> <p> Where <em>IDENTIFIER</em> is the name of the identifier up to 40 characters long and <em>EXPRESSION</em> is any valid expression which evaluates to a float value. </p> <p class="Note"> <strong>Note:</strong> there should be a semi-colon after the expression in a float declaration. If omitted, it generates a warning and some macros may not work properly. See " <a href="s_98.html#s03_02_02_02_02">#declare vs. #local</a>" for information on identifier scope. </p> <p> Here are some examples. </p> <pre> #declare Count = 0; #declare Rows = 5.3; #declare Cols = 6.15; #declare Number = Rows*Cols; #declare Count = Count+1; </pre> <p> As the last example shows, you can re-declare a float identifier and may use previously declared values in that re-declaration. There are several built-in identifiers which POV-Ray declares for you. See "Float Expressions: <a href="s_97.html#s03_02_01_03_06">Built-in Variables</a>" for details. </p> <h5><a name="s03_02_01_03_03">3.2.1.3.3 </a>Operators</h5> <a name="s03_02_01_03_03_i1"><a name="Operators, float"></a><a name="s03_02_01_03_03_i2"><a name="Float, operators"></a> <p> <strong>Arithmetic expressions:</strong> Basic math expressions can be created from float literals, identifiers or functions using the following operators in this order of precedence... </p> <table summary="Arithmetic expressions" width="75%"> <tr> <td width="30%"> <code>( )</code> </td> <td width="70%"> expressions in parentheses first </td> </tr> <tr> <td> <code>+A -A !A</code> </td> <td> unary minus, unary plus and logical "not" </td> </tr> <tr> <td> <code>A*B A/B</code> </td> <td> multiplication and division </td> </tr> <tr> <td> <code>A+B A-B</code> </td> <td> addition and subtraction </td> </tr> </table> <p> Relational, logical and conditional expressions may also be created. However there is a restriction that these types of expressions must be enclosed in parentheses first. This restriction, which is not imposed by most computer languages, is necessary because POV-Ray allows mixing of float and vector expressions. Without the parentheses there is an ambiguity problem. Parentheses are not required for the unary logical not operator "!" as shown above. The operators and their precedence are shown here. </p> <p> <strong> Relational expressions:</strong> The operands are arithmetic expressions and the result is always boolean with 1 for true and 0 for false. All relational operators have the same precedence. </p> <table summary="Relational expressions" width="75%"> <tr> <td width="30%"> <code>(A < B)</code> </td> <td width="70%"> A is less than B </td> </tr> <tr> <td> <code>(A <= B)</code> </td> <td> A is less than or equal to B </td> </tr> <tr> <td> <code>(A = B)</code> </td> <td> A is equal to B (actually abs(A-B)<EPSILON) </td> </tr> <tr> <td> <code>(A != B)</code> </td> <td> A is not equal to B (actually abs(A-B)>=EPSILON) </td> </tr> <tr> <td> <code>(A >= B)</code> </td> <td> A is greater than or equal to B </td> </tr> <tr> <td> <code>(A > B)</code> </td> <td> A is greater than B </td> </tr> </table> <p> <strong>Logical expressions:</strong> The operands are converted to boolean values of 0 for false and 1 for true. The result is always boolean. All logical operators have the same precedence. </p> <p class="Note"> <strong>Note:</strong> these are not bit-wise operations, they are logical. </p> <table summary="Logical expressions" width="75%"> <tr> <td width="30%"> <code>(A & B)</code> </td> <td width="70%"> true only if both A and B are true, false otherwise </td> </tr> <tr> <td> <code>(A | B)</code> </td> <td> true if either A or B or both are true </td> </tr> </table> <p> <strong>Conditional expressions:</strong> The operand C is boolean while operands A and B are any expressions. The result is of the same type as A and B. </p> <table summary="Conditional expressions" width="75%"> <tr> <td width="30%"> <code>(C ? A : B)</code> </td> <td width="70%"> if C then A else B </td> </tr> </table> <p> Assuming the various identifiers have been declared, the following are examples of valid expressions... </p> <pre> 1+2+3 2*5 1/3 Row*3 Col*5 (Offset-5)/2 This/That+Other*Thing ((This<That) & (Other>=Thing)?Foo:Bar) </pre> <p> Expressions are evaluated left to right with innermost parentheses evaluated first, then unary +, - or !, then multiply or divide, then add or subtract, then relational, then logical, then conditional. </p> <h5><a name="s03_02_01_03_04">3.2.1.3.4 </a>Functions</h5> <a name="s03_02_01_03_04_i1"><a name="Float, functions"></a><a name="s03_02_01_03_04_i2"><a name="Functions, float"></a> <p> POV-Ray defines a variety of built-in functions for manipulating floats, vectors and strings. Function calls consist of a keyword which specifies the name of the function followed by a parameter list enclosed in parentheses. Parameters are separated by commas. For example: </p> <pre> keyword(param1,param2) </pre> <p> The following are the functions which return float values. They take one or more float, integer, vector, or string parameters. Assume that <code> A</code> and <code>B</code> are any valid expression that evaluates to a float; <code>I</code> is a float which is truncated to integer internally, <code>S</code>, <code>S1</code>, <code>S2</code> etc. are strings, and <code> V</code>, <code>V1</code>, <code>V2</code> etc. are any vector expressions.<code>O</code> is an object identifier to a pre-declared object. </p> <p> <a name="s03_02_01_03_04_i3"><a name="abs"></a> <code>abs(A)</code> Absolute value of <code>A</code>. If <code>A</code> is negative, returns <code>-A</code> otherwise returns <code>A</code>. </p> <p> <a name="s03_02_01_03_04_i4"><a name="acos"></a> <code> acos(A)</code> Arc-cosine of <code>A</code>. Returns the angle, measured in radians, whose cosine is <code>A</code>. </p> <p> <a name="s03_02_01_03_04_i5"><a name="acosh"></a> <code>acosh(A)</code> inverse hyperbolic cosine of <code>A</code>. </p> <p> <a name="s03_02_01_03_04_i6"><a name="asc"></a> <code> asc(S)</code> Returns an integer value in the range 0 to 255 that is the ASCII value of the first character of the string <code>S</code>. For example <code> asc("ABC")</code> is 65 because that is the value of the character "A". </p> <p> <a name="s03_02_01_03_04_i7"><a name="asin"></a> <code>asin(A)</code> Arc-sine of <code> A</code>. Returns the angle, measured in radians, whose sine is <code> A</code>. </p> <p> <a name="s03_02_01_03_04_i8"><a name="asinh"></a> <code>asinh(A)</code> invers hyperbolic sine of <code>A</code> </p> <p> <a name="s03_02_01_03_04_i9"><a name="atan2"></a> <code> atan2(A,B)</code> Arc-tangent of <code>(A/B)</code>. Returns the angle, measured in radians, whose tangent is <code> (A/B)</code>. Returns appropriate value even if <code>B</code> is zero. Use <code>atan2(A,1)</code> to compute usual atan(A) function. </p> <p> <a name="s03_02_01_03_04_i10"><a name="atanh"></a> <code>atanh(A)</code> invers hyperbolic tangent of <code>A</code> </p> <p> <a name="s03_02_01_03_04_i11"><a name="ceil"></a> <code> ceil(A)</code> Ceiling of <code> A</code>. Returns the smallest integer greater than <code>A</code>. Rounds up to the next higher integer. </p> <p> <a name="s03_02_01_03_04_i12"><a name="cos"></a> <code>cos(A)</code> Cosine of <code>A</code>. Returns the cosine of the angle <code>A</code>, where <code>A</code> is measured in radians. </p> <p> <a name="s03_02_01_03_04_i13"><a name="cosh"></a> <code>cosh(A)</code> The hyperbolic cosine of <code>A</code>. </p> <p> <a name="s03_02_01_03_04_i14"><a name="defined"></a> <code> defined(</code><em>IDENTIFIER</em><code>)</code> Returns <code> true</code> if the identifier is currently defined, <code> false</code> otherwise. This is especially useful for detecting end-of-file after a <code> #read</code> directive because the file identifier is automatically undefined when end-of-file is reached. See "<a href="s_98.html#s03_02_02_03_03">The #read Directive</a>" for details. </p> <p> <a name="s03_02_01_03_04_i15"><a name="degrees"></a> <code>degrees(A)</code> Convert radians to degrees. Returns the angle measured in degrees whose value in radians is <code>A</code>. Formula is <em> degrees=A/pi*180.0</em>. </p> <p> <a name="s03_02_01_03_04_i16"><a name="dimensions"></a> <code> dimensions(</code> <em>ARRAY_IDENTIFIER</em> <code>)</code> Returns the number of dimensions of a previously declared array identifier. For example if you do <code>#declare MyArray=array[6][10]</code> then <code> dimensions(MyArray)</code> returns the value <code>2</code>. </p> <p> <a name="s03_02_01_03_04_i17"><a name="dimension_size"></a> <code> dimension_size(</code> <em> ARRAY_IDENTIFIER, FLOAT</em> <code> )</code> Returns the size of a given dimension of a previously declared array identifier. Dimensions are numbered left-to-right starting with 1. For example if you do <code> #declare MyArray=array[6][10]</code> then <code> dimension_size(MyArray,2)</code> returns the value <code>10</code>. </p> <p> <a name="s03_02_01_03_04_i18"><a name="div"></a> <code> div(A,B)</code> Integer division. The integer part of <code> (A/B)</code>. </p> <p> <a name="s03_02_01_03_04_i19"><a name="exp"></a> <code>exp(A)</code> Exponential of <code>A</code>. Returns the value of <em> e</em> raised to the power <code> A</code> where <em>e</em> is the base of the natural logarithm, i.e. the non-repeating value approximately equal to 2.71828182846. </p> <p> <a name="s03_02_01_03_04_i20"><a name="file_exists"></a> <code>file_exists(S)</code> Attempts to open the file specified by the string <code>S</code>. The current directory and all library directories specified by the <code>Library_Path</code> or <code> +L</code> options are also searched. See "<a href="s_95.html#s03_01_02_05_04">Library Paths</a>" for details. Returns <code> 1</code> if successful and <code>0</code> if unsuccessful. </p> <p> <a name="s03_02_01_03_04_i21"><a name="floor"></a> <code> floor(A)</code> Floor of <code>A</code>. Returns the largest integer less than <code>A</code>. Rounds down to the next lower integer. </p> <p> <a name="s03_02_01_03_04_i22"><a name="inside"></a> <code>inside(O,V)</code> It returns either 0.0, when the vector <code>V</code> is outside the object, specified by the object-identifier <code>O</code>, or 1.0 if it is inside. </p> <p class="Note"> <strong>Note:</strong> <code>inside</code> does not accept object-identifiers to non-solid objects. </p> <p> <a name="s03_02_01_03_04_i23"><a name="int"></a> <code> int(A)</code> Integer part of <code>A</code>. Returns the truncated integer part of <code>A</code>. Rounds towards zero. </p> <p> <a name="s03_02_01_03_04_i24"><a name="log"></a> <code> log(A)</code> Logarithm of <code>A</code>. Returns the logarithm base <em>10</em> of the value <code>A</code>. </p> <p> <a name="s03_02_01_03_04_i25"><a name="ln"></a> <code> ln(A)</code> Natural logarithm of <code>A</code>. Returns the natural logarithm base <em>e</em> of the value <code>A</code>. </p> <p> <a name="s03_02_01_03_04_i26"><a name="max"></a> <code> max(A,B,...)</code> Maximum of two or more float values. Returns <code>A</code> if <code>A</code> larger than <code>B</code>. Otherwise returns <code>B</code>. </p> <p> <a name="s03_02_01_03_04_i27"><a name="min"></a> <code>min(A,B,...)</code> Minimum of two or more float values. Returns <code>A</code> if <code>A</code> smaller than <code> B</code>. Otherwise returns <code>B</code>. </p> <p> <a name="s03_02_01_03_04_i28"><a name="mod"></a> <code>mod(A,B)</code> Value of <code>A</code> modulo <code> B</code>. Returns the remainder after the integer division of <code> A</code>/<code>B</code>. Formula is <em> mod=((A/B)-int(A/B))*B</em>. </p> <p> <a name="s03_02_01_03_04_i29"><a name="pow"></a> <code> pow(A,B)</code> Exponentiation. Returns the value of <code>A</code> raised to the power <code>B</code>. </p> <p class="Warning"> <strong>Note:</strong>For a negative A and a non-integer B the function has no defined return value. The result then may depend on the platform POV-Ray is compiled on. </p> <p> <a name="s03_02_01_03_04_i30"><a name="radians"></a> <code> radians(A)</code> Convert degrees to radians. Returns the angle measured in radians whose value in degrees is <code>A</code>. Formula is <em> radians=A*pi/180.0</em>. </p> <p> <a name="s03_02_01_03_04_i31"><a name="rand"></a> <code>rand(I)</code> Returns the next pseudo-random number from the stream specified by the positive integer <code>I</code>. You must call <code> seed()</code> to initialize a random stream before calling <code> rand()</code>. The numbers are uniformly distributed, and have values between <code>0.0</code> and <code>1.0</code>, inclusively. The numbers generated by separate streams are independent random variables. </p> <p> <a name="s03_02_01_03_04_i32"><a name="seed"></a> <code> seed(I)</code> Initializes a new pseudo-random stream with the initial seed value <code>A</code>. The number corresponding to this random stream is returned. Any number of pseudo-random streams may be used as shown in the example below: </p> <pre> #declare R1 = seed(0); #declare R2 = seed(12345); sphere { <rand(R1), rand(R1), rand(R1)>, rand(R2) } </pre> <p> Multiple random generators are very useful in situations where you use <code>rand()</code> to place a group of objects, and then decide to use <code>rand()</code> in another location earlier in the file to set some colors or place another group of objects. Without separate <code> rand()</code> streams, all of your objects would move when you added more calls to <code>rand()</code>. This is very annoying. </p> <p> <a name="s03_02_01_03_04_i33"><a name="select"></a> <code>select(A, B, C [,D])</code>. It can be used with three or four parameters. <code>Select</code> compares the first argument with zero, depending on the outcome it will return <code>B</code>, <code>C</code> or <code>D</code>. <code>A,B,C,D</code> can be floats or funtions.<br> When used with three parameters, if <code>A < 0</code> it will return <code>B</code>, else <code>C</code> (<code>A >= 0</code>).<br> When used with four parameters, if <code>A < 0</code> it will return B. If <code>A = 0</code> it will return <code>C</code>. Else it will return <code>D</code> (<code>A > 0</code>). </p> <p> Example:<br> If <code>A</code> has the consecutive values -2, -1, 0, 1, and 2 : </p> <pre> // A = -2 -1 0 1 2 select (A, -1, 0, 1) //returns -1 -1 0 1 1 select (A, -1, 1) //returns -1 -1 1 1 1 </pre> <p> <a name="s03_02_01_03_04_i34"><a name="sin"></a> <code>sin(A)</code> Sine of <code>A</code>. Returns the sine of the angle <code>A</code>, where <code> A</code> is measured in radians. </p> <p> <a name="s03_02_01_03_04_i35"><a name="sinh"></a> <code>sinh(A)</code> The hyperbolic sine of <code>A</code>. </p> <p> <a name="s03_02_01_03_04_i36"><a name="strcmp"></a> <code>strcmp(S1,S2)</code> Compare string <code>S1</code> to <code> S2</code>. Returns a float value zero if the strings are equal, a positive number if <code>S1</code> comes after <code>S2</code> in the ASCII collating sequence, else a negative number. </p> <p> <a name="s03_02_01_03_04_i37"><a name="strlen"></a> <code> strlen(S)</code> Length of <code>S</code>. Returns an integer value that is the number of characters in the string <code>S</code>. </p> <p> <a name="s03_02_01_03_04_i38"><a name="sqrt"></a> <code> sqrt(A)</code> Square root of <code>A</code>. Returns the value whose square is <code> A</code>. </p> <p> <a name="s03_02_01_03_04_i39"><a name="tan"></a> <code>tan(A)</code> Tangent of <code>A</code>. Returns the tangent of the angle <code>A</code>, where <code>A</code> is measured in radians. </p> <p> <a name="s03_02_01_03_04_i40"><a name="tanh"></a> <code>tanh(A)</code> The hyperbolic tangent of <code>A</code>. </p> <p> <a name="s03_02_01_03_04_i41"><a name="val"></a> <code>val(S)</code> Convert string <code>S</code> to float. Returns a float value that is represented by the text in string <code>S</code>. For example <code>val("123.45")</code> is 123.45 as a float. </p> <p> <a name="s03_02_01_03_04_i42"><a name="vdot"></a> <code>vdot(V1,V2)</code> Dot product of <code>V1</code> and <code>V2</code>. Returns a float value that is the dot product (sometimes called scalar product) of <code>V1</code> with <code>V2</code>. It is directly proportional to the length of the two vectors and the cosine of the angle between them. Formula is <em>vdot=V1.x*V2.x + V1.y*V2.y + V1.z*V2.z.</em> See the animated demo scene <code>VECT2.POV</code> for an illustration. </p> <p> <a name="s03_02_01_03_04_i43"><a name="vlength"></a> <code>vlength(V)</code> Length of <code>V</code>. Returns a float value that is the length of vector <code> V</code>. Formula is <em> vlength=sqrt(vdot(A,A))</em>. Can be used to compute the distance between two points. <code> Dist=vlength(V2-V1)</code>. </p> <p> See section "<a href="s_97.html#s03_02_01_04_05">Vector Functions</a>" and section "<a href="s_97.html#s03_02_01_07_03">String Functions</a>" for other functions which are somewhat float-related but which return vectors and strings. In addition to the above built-in functions, you may also define your own functions using the <code>#macro</code> directive. See the section "<a href="s_98.html#s03_02_02_08">User Defined Macros</a>" for more details. </p> <h5><a name="s03_02_01_03_05">3.2.1.3.5 </a>Built-in Constants</h5> <a name="s03_02_01_03_05_i1"><a name="s03_02_01_03_05_i2"><a name="s03_02_01_03_05_i3"><a name="Float, built-in constants"></a> <p> Constants are: </p> <pre> FLOAT_BUILT-IN_IDENT: false | no | off | on | pi | true | yes </pre> <p> The built-in constants never change value. They are defined as though the following lines were at the start of every scene. </p> <pre> #declare pi = 3.1415926535897932384626; #declare true = 1; #declare yes = 1; #declare on = 1; #declare false = 0; #declare no = 0; #declare off = 0; </pre> <a name="s03_02_01_03_05_i4"><a name="true"></a><a name="s03_02_01_03_05_i5"><a name="false"></a><a name="s03_02_01_03_05_i6"><a name="yes"></a><a name="s03_02_01_03_05_i7"><a name="no"></a><a name="s03_02_01_03_05_i8"><a name="on"></a><a name="s03_02_01_03_05_i9"><a name="off"></a><a name="s03_02_01_03_05_i10"><a name="pi"></a> <p> The built-in float identifier <code>pi</code> is obviously useful in math expressions involving circles. The built-in float identifiers <code> on</code>, <code>off</code>, <code>yes</code>, <code>no</code>, <code> true</code>, and <code>false</code> are designed for use as boolean constants. </p> <p> The built-in float constats <code>on</code>, <code>off</code>, <code> yes</code>, <code>no</code>, <code>true</code>, and <code>false</code> are most often used as boolean values with object modifiers or parameters such as <code><a href="s_113.html#s03_04_09_09">sturm</a></code>, <code><a href="s_113.html#s03_04_09_05">hollow</a></code>, <code><a href="s_105.html#s03_04_01_01">hierarchy</a></code>, <code><a href="s_105.html#s03_04_01_05">smooth</a></code>, <code><a href="s_111.html#s03_04_07_11">media_attenuation</a></code>, and <code><a href="s_111.html#s03_04_07_10">media_interaction</a></code>. Whenever you see syntax of the form <code>keyword</code> <em><code>[Bool]</code></em>, if you simply specify the keyword without the optional boolean then it assumes <code>keyword on</code>. You need not use the boolean but for readability it is a good idea. You must use one of the false booleans or an expression which evaluates to zero to turn it off. </p> <p class="Note"> <strong>Note:</strong> some of these keywords are <code>on</code> by default, if no keyword is specified. </p> <p> For example: </p> <pre> object { MyBlob } // sturm defaults off, but // hierarchy defaults on object { MyBlob sturm } // turn sturm on object { MyBlob sturm on } // turn sturm on object { MyBlob sturm off } // turn sturm off object { MyBlob hierarchy } // does nothing, hierarchy was // already on object { MyBlob hierarchy off } // turn hierarchy off </pre> <h5><a name="s03_02_01_03_06">3.2.1.3.6 </a>Built-in Variables</h5> <a name="s03_02_01_03_06_i1"><a name="Float, built-in variables"></a> <p> There are several built-in float variables. You can use them to specify values or to create expressions but you cannot re-declare them to change their values. </p> <p> Clock-related are: </p> <pre> FLOAT_BUILT-IN_IDENT: clock | clock_delta | clock_on | final_clock | final_frame frame_number | initial_clock | initial_frame </pre> <p> These keywords allow to use the values of the clock which have been set in the command line switch options (or INI-file). They represent float or integer values, read from the animation options. You cannot re-declare these identifiers.<a name="s03_02_01_03_06_i2"><a name="clock"></a> </p> <p> <code><strong>clock</strong></code> <br>The built-in float identifier <code>clock</code> is used to control animations in POV-Ray. Unlike some animation packages, the action in POV-Ray animated scenes does not depend upon the integer frame numbers. Rather you should design your scenes based upon the float identifier <code> clock</code>. For non-animated scenes its default value is 0 but you can set it to any float value using the INI file option <code>Clock=</code><em>n.n</em> or the command-line switch <code>+K</code><em>n.n</em> to pass a single float value your scene file. </p> <p> Other INI options and switches may be used to animate scenes by automatically looping through the rendering of frames using various values for <code> clock</code>. By default, the clock value is 0 for the initial frame and 1 for the final frame. All other frames are interpolated between these values. <br>For example if your object is supposed to rotate one full turn over the course of the animation you could specify <code>rotate 360*clock*y</code>. Then as clock runs from 0 to 1, the object rotates about the y-axis from 0 to 360 degrees. </p> <p> Although the value of <code> clock</code> will change from frame-to-frame, it will never change throughout the parsing of a scene.<a name="s03_02_01_03_06_i3"><a name="clock_delta"></a> </p> <p> <code><strong>clock_delta</strong></code> <br>The built-in float identifier <code>clock_delta</code> returns the amount of time between clock values in animations in POV-Ray. While most animations only need the clock value itself, some animation calculations are easier if you know how long since the last frame. Caution must be used when designing such scenes. If you render a scene with too few frames, the results may be different than if you render with more frames in a given time period. On non-animated scenes, <code>clock_delta</code> defaults to 1.0. See section "<a href="s_95.html#s03_01_02_01">Animation Options</a>" for more details.<a name="s03_02_01_03_06_i4"><a name="clock_on"></a> </p> <p> <code><strong>clock_on</strong></code> <br>With this identifier the status of the clock can be checked: 1 is on, 0 is off. </p> <pre> #if(clock_on=0) //stuff for still image #else //some animation #end </pre> <a name="s03_02_01_03_06_i5"><a name="frame_number"></a> <p> <code><strong>frame_number</strong></code> <br>If you rather want to define the action in POV-Ray animated scenes depending upon the integer frame numbers, this identifier can be used. <br>It reads the number of the frame currently being rendered. </p> <pre> #if(frame_number=1) //stuff for first image or frame #end #if(frame_number=2) //stuff for second image or frame #end #if(frame_number=n) //stuff for n th image or frame #end </pre> <a name="s03_02_01_03_06_i6"><a name="initial_clock"></a> <p> <code><strong>initial_clock</strong></code> <br>This identifier reads the value set through the INI file option <code>Initial_Clock=</code><em>n.n</em> or the command-line switch <code>+KI</code><em>n.n</em>.<a name="s03_02_01_03_06_i7"><a name="final_clock"></a> </p> <p> <code><strong>final_clock</strong></code> <br>This identifier reads the value set through the INI file option <code>Final_Clock=</code><em>n.n</em> or the command-line switch <code>+KF</code><em>n.n</em>.<a name="s03_02_01_03_06_i8"><a name="initial_frame"></a> </p> <p> <code><strong>initial_frame</strong></code> <br>This identifier reads the value set through the INI file option <code>Initial_Frame=</code><em>n</em> or the command-line switch <code>+KFI</code><em>n</em>.<a name="s03_02_01_03_06_i9"><a name="final_frame"></a> </p> <p> <code><strong>final_frame</strong></code> <br>This identifier reads the value set through the INI file option <code>Final_Frame=</code><em>n</em> or the command-line switch <code>+KFF</code><em>n</em>. </p> <p class="Note"> <strong>Note:</strong> that these values are the ones actually used. When the option 'cyclic animation' is set, they could be different from the ones originally set in the options. </p> <p> Image-size are: </p> <pre> FLOAT_BUILT-IN_IDENT: image_width | image_height </pre> <a name="s03_02_01_03_06_i10"><a name="image_width"></a> <p> <code><strong>image_width</strong></code> <br>This identifier reads the value set through the INI file option <code>Width=</code><em>n</em> or the command-line switch <code>+W</code><em>n</em>.<a name="s03_02_01_03_06_i11"><a name="image_height"></a> </p> <p> <code><strong>image_height</strong></code> <br>This identifier reads the value set through the INI file option <code>Height=</code><em>n</em> or the command-line switch <code>+H</code><em>n</em>. </p> <p> You could use these keywords to set the camera ratio (up and right vectors) correctly. The viewing angle of the camera covers the full width of the rendered image. The camera ratio will always follow the ratio of the image width to height, regardless of the set image size. Use it like this: </p> <pre> up y*image_height right x*image_width </pre> <p> You could also make some items of the scene dependent on the image size: </p> <pre> #if (image_width < 300) crand 0.1 #else crand 0.5 #end or: image_map { pattern image_width, image_width { //make pattern resolution gradient x //dependent of render width color_map { [ 0.0 ... ] [ 1.0 ... ] } } } </pre> <p> Version is: </p> <pre> FLOAT_BUILT-IN_IDENT: version </pre> <p> The built-in float variable <code> version</code> contains the current setting of the version compatibility option. Although this value defaults to the current POV-Ray version number, the initial value of <code> version</code> may be set by the INI file option <code> Version=</code><em>n.n</em> or by the <code> +MV</code><em>n.n</em> command-line switch. This tells POV-Ray to parse the scene file using syntax from an earlier version of POV-Ray. </p> <p> The INI option or switch only affects the initial setting. Unlike other built-in identifiers, you may change the value of <code>version</code> throughout a scene file. You do not use <code>#declare</code> to change it though. The <code> #version</code> language directive is used to change modes. Such changes may occur several times within scene files. </p> <p> Together with the built-in <code> version</code> identifier the <code> #version</code> directive allows you to save and restore the previous values of this compatibility setting. The new <code>#local</code> identifier option is especially useful here. For example suppose <code>mystuff.inc</code> is in version 1 format. At the top of the file you could put: </p> <pre> #local Temp_Vers = version; // Save previous value #version 1.0; // Change to 1.0 mode ... // Version 1.0 stuff goes here... #version Temp_Vers; // Restore previous version </pre> <p class="Note"> <strong>Note:</strong> there should be a semi-colon after the float expression in a <code>#version</code> directive. If omitted, it generates a warning and some macros may not work properly. </p> <h4><a name="s03_02_01_04">3.2.1.4 </a>Vector Expressions</h4> <a name="s03_02_01_04_i1"><a name="s03_02_01_04_i2"><a name="s03_02_01_04_i3"><a name="Vector"></a> <p> POV-Ray often requires you to specify a <em>vector</em>. A vector is a set of related float values. Vectors may be specified using literals, identifiers or functions which return vector values. You may also create very complex vector expressions from combinations of any of these using various familiar operators. </p> <p> POV-Ray vectors may have from two to five components but the vast majority of vectors have three components. Unless specified otherwise, you should assume that the word "vector" means a three component vector. POV-Ray operates in a 3D x, y, z coordinate system and you will use three component vectors to specify x, y and z values. In some places POV-Ray needs only two coordinates. These are often specified by a 2D vector called an <em> UV vector</em>. Fractal objects use 4D vectors. Color expressions use 5D vectors but allow you to specify 3, 4 or 5 components and use default values for the unspecified components. Unless otherwise noted, all 2, 4 or 5 component vectors work just like 3D vectors but they have a different number of components. </p> <p> The syntax for combining vector literals into vector expressions is almost identical to the rules for float expressions. In the syntax for vector expressions below, some of the syntax items are defined in the section for float expressions. See "<a href="s_97.html#s03_02_01_03">Float Expressions</a>" for those definitions. Detailed explanations of vector-specific issues are given in the following sub-sections. </p> <pre> VECTOR: NUMERIC_TERM [SIGN NUMERIC_TERM] NUMERIC_TERM: NUMERIC_FACTOR [MULT NUMERIC_FACTOR] NUMERIC_FACTOR: VECTOR_LITERAL | VECTOR_IDENTIFIER | SIGN NUMERIC_FACTOR | VECTOR_FUNCTION | VECTOR_BUILT-IN_IDENT | ( FULL_EXPRESSION ) | ! NUMERIC_FACTOR | FLOAT VECTOR_LITERAL: < FLOAT , FLOAT , FLOAT > VECTOR_FUNCTION: min_extent ( OBJECT_IDENTIFIER ) | max_extent ( OBJECT_IDENTIFIER ) | trace(OBJECT_IDENTIFIER, VECTOR, VECTOR, [VECTOR_IDENTIFIER] )| vaxis_rotate( VECTOR , VECTOR , FLOAT ) | vcross( VECTOR , VECTOR ) | vrotate( VECTOR , VECTOR ) | vnormalize( VECTOR ) | vturbulence(FLOAT, FLOAT, FLOAT, VECTOR) VECTOR_BUILT-IN_IDENT: x | y | z | t | u | v </pre> <p class="Note"> Note: <em>VECTOR_IDENTIFIERS</em> are identifiers previously declared to have vector values. </p> <h5><a name="s03_02_01_04_01">3.2.1.4.1 </a>Literals</h5> <a name="s03_02_01_04_01_i1"><a name="s03_02_01_04_01_i2"> <p> Vector literals consist of two to five float expressions that are bracketed by angle brackets <code><</code> and <code>></code>. The terms are separated by commas. For example here is a typical three component vector: </p> <pre> < 1.0, 3.2, -5.4578 > </pre> <p> The commas between components are necessary to keep the program from thinking that the 2nd term is the single float expression <code> 3.2-5.4578</code> and that there is no 3rd term. If you see an error message such as "Float expected but '>' found instead" then you probably have missed a comma. </p> <p> Sometimes POV-Ray requires you to specify floats and vectors side-by-side. The rules for vector expressions allow for mixing of vectors with vectors or vectors with floats so commas are required separators whenever an ambiguity might arise. For example <code> <1,2,3>-4</code> evaluates as a mixed float and vector expression where 4 is subtracted from each component resulting in <code> <-3,-2,-1></code>. However the comma in <code> <1,2,3>,-4</code> means this is a vector followed by a float. </p> <p> Each component may be a full float expression. For example </p> <pre> <This+3,That/3,5*Other_Thing> </pre> <p> is a valid vector. </p> <h5><a name="s03_02_01_04_02">3.2.1.4.2 </a>Identifiers</h5> <a name="s03_02_01_04_02_i1"><a name="s03_02_01_04_02_i2"> <p> Vector identifiers may be declared to make scene files more readable and to parameterize scenes so that changing a single declaration changes many values. An identifier is declared as follows. </p> <pre> VECTOR_DECLARATION: #declare IDENTIFIER = EXPRESSION; | #local IDENTIFIER = EXPRESSION; </pre> <p> Where <em>IDENTIFIER</em> is the name of the identifier up to 40 characters long and <em>EXPRESSION</em> is any valid expression which evaluates to a vector value. </p> <p class="Note"> <strong>Note:</strong> there should be a semi-colon after the expression in a vector declaration. If omitted, it generates a warning and some macros may not work properly. See " <a href="s_98.html#s03_02_02_02_02">#declare vs. #local</a>" for information on identifier scope. </p> <p> Here are some examples.... </p> <pre> #declare Here = <1,2,3>; #declare There = <3,4,5>; #declare Jump = <Foo*2,Bar-1,Bob/3>; #declare Route = There-Here; #declare Jump = Jump+<1,2,3>; </pre> <p class="Note"> <strong>Note:</strong> you invoke a vector identifier by using its name without any angle brackets. As the last example shows, you can re-declare a vector identifier and may use previously declared values in that re-declaration. There are several built-in identifiers which POV-Ray declares for you. See section "<a href="s_97.html#s03_02_01_04_06">Built-in Vector Identifiers</a>" for details. </p> <h5><a name="s03_02_01_04_03">3.2.1.4.3 </a>Operators</h5> <a name="s03_02_01_04_03_i1"><a name="Vector, operators"></a><a name="s03_02_01_04_03_i2"><a name="Operators, vector"></a> <p> Vector literals, identifiers and functions may also be combined in expressions the same as float values. Operations are performed on a component-by-component basis. For example <code><1,2,3> + <4,5,6></code> evaluates the same as <code><1+4,2+5,3+6></code> or <code><5,7,9></code>. Other operations are done on a similar component-by-component basis. For example <code>(<1,2,3> = <3,2,1>)</code> evaluates to <code><0,1,0></code> because the middle components are equal but the others are not. Admittedly this is not very useful but it is consistent with other vector operations. </p> <p> Conditional expressions such as <code>(C ? A : B)</code> require that <code> C</code> is a float expression but <code>A</code> and <code>B</code> may be vector expressions. The result is that the entire conditional evaluates as a valid vector. For example if <code>Foo</code> and <code> Bar</code> are floats then <code>(Foo < Bar ? <1,2,3> : <5,6,7>)</code> evaluates as the vector <code><1,2,3></code> if <code>Foo</code> is less than <code> Bar</code> and evaluates as <code> <5,6,7></code> otherwise. </p> <p> <a name="s03_02_01_04_03_i3"><a name="t"></a><a name="s03_02_01_04_03_i4"><a name="u"></a><a name="s03_02_01_04_03_i5"><a name="v"></a><a name="s03_02_01_04_03_i6"><a name="x"></a><a name="s03_02_01_04_03_i7"><a name="y"></a><a name="s03_02_01_04_03_i8"><a name="z"></a> You may use the dot operator to extract a single float component from a vector. Suppose the identifier <code> Spot</code> was previously defined as a vector. Then <code>Spot.x</code> is a float value that is the first component of this x, y, z vector. Similarly <code>Spot.y</code> and <code>Spot.z</code> reference the 2nd and 3rd components. If <code>Spot</code> was a two component UV vector you could use <code>Spot.u</code> and <code>Spot.v</code> to extract the first and second component. For a 4D vector use <code> .x</code>, <code> .y</code>, <code>.z</code>, and <code>.t</code> to extract each float component. The dot operator is also used in color expressions which are covered later. </p> <h5><a name="s03_02_01_04_04">3.2.1.4.4 </a>Operator Promotion</h5> <a name="s03_02_01_04_04_i1"> <p> You may use a lone float expression to define a vector whose components are all the same. POV-Ray knows when it needs a vector of a particular type and will promote a float into a vector if need be. For example the POV-Ray <code>scale</code> statement requires a three component vector. If you specify <code>scale 5</code> then POV-Ray interprets this as <code>scale <5,5,5></code> which means you want to scale by 5 in every direction. </p> <p> Versions of POV-Ray prior to 3.0 only allowed such use of a float as a vector in various limited places such as <code>scale</code> and <code> turbulence</code>. However you may now use this trick anywhere. For example... </p> <pre> box{0,1} // Same as box{<0,0,0>,<1,1,1>} sphere{0,1} // Same as sphere{<0,0,0>,1} </pre> <p> When promoting a float into a vector of 2, 3, 4 or 5 components, all components are set to the float value, however when promoting a vector of a lower number of components into a higher order vector, all remaining components are set to zero. For example if POV-Ray expects a 4D vector and you specify <code>9</code> the result is <code><9,9,9,9></code> but if you specify <code><7,6></code> the result is <code> <7,6,0,0></code>. </p> <h5><a name="s03_02_01_04_05">3.2.1.4.5 </a>Functions</h5> <a name="s03_02_01_04_05_i1"><a name="Vector, functions"></a><a name="s03_02_01_04_05_i2"><a name="Functions, vector"></a> <p> POV-Ray defines a variety of built-in functions for manipulating floats, vectors and strings. Function calls consist of a keyword which specifies the name of the function followed by a parameter list enclosed in parentheses. Parameters are separated by commas. For example: </p> <pre> keyword(param1,param2) </pre> <p> The following are the functions which return vector values. They take one or more float, integer, vector, or string parameters. Assume that <code> A</code> and <code>B</code> are any valid expression that evaluates to a vector; and <code>F</code> is any float expression.<a name="s03_02_01_04_05_i3"><a name="min_extent"></a><a name="s03_02_01_04_05_i4"><a name="max_extent"></a> </p> <p> <code>min_extent(OBJECT_IDENTIFIER), max_extent(OBJECT_IDENTIFIER)</code>. The <code>min_extent</code> and <code>max_extent</code> return the minimum and maximum coordinates of a #declared object's bounding box (Corner1 and Corner2), in effect allowing you to find the dimensions and location of the object. </p> <p class="Note"> <strong>Note:</strong> this is not perfect, in some cases (such as CSG intersections and differences or isosurfaces) the bounding box does not represent the actual dimensions of the object. </p> <p> Example: </p> <pre> #declare Sphere = sphere { <0,0,0>, 1 pigment { rgb <1,0,0> } } #declare Min = min_extent ( Sphere ); #declare Max = max_extent ( Sphere ); object { Sphere } box { Min, Max pigment { rgbf <1,1,1,0.5> } } </pre> <a name="s03_02_01_04_05_i5"><a name="trace"></a> <p> <code>trace(OBJECT_IDENTIFIER, A, B, [VECTOR_IDENTIFIER])</code>. <code>trace</code> helps you finding the exact location of a ray intersecting with an object's surface. It traces a ray beginning at the point <code>A</code> in the direction specified by the vector <code>B</code>. If the ray hits the specified object, this function returns the coordinate where the ray intersected the object. If not, it returns <code><0,0,0></code>. If a fourth parameter in the form of a vector identifier is provided, the normal of the object at the intersection point (not including any normal perturbations due to textures) is stored into that vector. If no intersection was found, the normal vector is reset to <code><0,0,0></code>. </p> <p class="Note"> <strong>Note:</strong> Checking the normal vector for <code><0,0,0></code> is the only reliable way to determine whether an intersection has actually occurred, intersections can and do occur anywhere, including at <code><0,0,0></code>. </p> <p> Example: </p> <pre> #declare MySphere = sphere { <0, 0, 0>, 1 } #declare Norm = <0, 0, 0>; #declare Start = <1, 1, 1>; #declare Inter= trace ( MySphere, Start, <0, 0, 0>-Start, Norm ); object { MySphere texture { pigment { rgb 1} } } #if (vlength(Norm)!=0) cylinder { Inter, Inter+Norm, .1 texture { pigment {color red 1} } } #end </pre> <a name="s03_02_01_04_05_i6"><a name="vaxis_rotate"></a> <p> <code>vaxis_rotate(A,B,F)</code> Rotate <code>A</code> about <code> B</code> by <code>F</code>. Given the x,y,z coordinates of a point in space designated by the vector <code>A</code>, rotate that point about an arbitrary axis defined by the vector <code>B</code>. Rotate it through an angle specified in degrees by the float value <code>F</code>. The result is a vector containing the new x,y,z coordinates of the point.<a name="s03_02_01_04_05_i7"><a name="vcross"></a> </p> <p> <code>vcross(A,B)</code> Cross product of <code>A</code> and <code>B</code>. Returns a vector that is the vector cross product of the two vectors. The resulting vector is perpendicular to the two original vectors and its length is equal to the area of the parallelogram defined by them. Or to put in an other way, the cross product can also be formulated as:<em><code> AxB = |A| * |B| * sin(angle(A,B)) * perpendicular_unit_vector(A,B) </code></em> So the length of the resulting vector is proportional to the sine of the angle between <code>A</code> and <code>B</code>. See the animated demo scene <code>VECT2.POV</code> for an illustration.<a name="s03_02_01_04_05_i8"><a name="vnormalize"></a> </p> <p> <code>vnormalize(A)</code> Normalize vector <code> A</code>. Returns a unit length vector that is the same direction as <code> A</code>. Formula is <em> vnormalize(A)=A/vlength(A)</em>. </p> <p class="Warning"> <strong>Note:</strong><code>vnormalize(<0,0,0>)</code> will result in an error.<a name="s03_02_01_04_05_i9"><a name="vrotate"></a> </p> <p> <code>vrotate(A,B)</code> Rotate <code> A</code> about origin by <code> B</code>. Given the x,y,z coordinates of a point in space designated by the vector <code>A</code>, rotate that point about the origin by an amount specified by the vector <code>B</code>. Rotate it about the x-axis by an angle specified in degrees by the float value <code> B.x</code>. Similarly <code> B.y</code> and <code>B.z</code> specify the amount to rotate in degrees about the y-axis and z-axis. The result is a vector containing the new x,y,z coordinates of the point.<a name="s03_02_01_04_05_i10"><a name="vturbulence"></a> </p> <p> <code>vturbulence(Lambda, Omega, Octaves, A)</code> Turbulence vector at A. Given the x,y,z coordinates of a point in space designated by the vector A, return the turbulence vector for that point based on the numbers given for Lambda, Omega and Octaves. For the meaning of the parameters, check out the Lambda, Omega and Octaves sections.<br> The amount of turbulence can be controlled by multiplying the turbulence vector by a multiple. The frequency at which the turbulence vector changes can be controlled by multiplying A with a multiple. The turbulence vector returned by the function can be added to the original point A to obtain a turbulated version of the point A. Example :<br> <code>#declare MyVector = MyVector + Amount * vturbulence(2, 0.5, 6, MyVector * Frequency);</code> </p> <p> See section "<a href="s_97.html#s03_02_01_03_04">Float Functions</a>" for other functions which are somewhat vector-related but which return floats. In addition to the above built-in functions, you may also define your own functions using the <code>#macro</code> directive. See the section "<a href="s_98.html#s03_02_02_08">User Defined Macros</a>" for more details. </p> <h5><a name="s03_02_01_04_06">3.2.1.4.6 </a>Built-in Constants</h5> <a name="s03_02_01_04_06_i1"><a name="Vector, built-in identifiers"></a> <p> There are several built-in vector identifiers. You can use them to specify values or to create expressions but you cannot re-declare them to change their values. They are: </p> <pre> VECTOR_BUILT-IN_IDENT: x | y | z | t | u | v </pre> <p> All built-in vector identifiers never change value. They are defined as though the following lines were at the start of every scene. </p> <pre> #declare x = <1, 0, 0>; #declare y = <0, 1, 0>; #declare z = <0, 0, 1>; #declare t = <0, 0, 0, 1>; #declare u = <1, 0>; #declare v = <0, 1>; </pre> <p> The built-in vector identifiers <code>x</code>, <code>y</code>, and <code> z</code> provide much greater readability for your scene files when used in vector expressions. For example.... </p> <pre> plane { y, 1} // The normal vector is obviously "y". plane { <0,1,0>, 1} // This is harder to read. translate 5*x // Move 5 units in the "x" direction. translate <5,0,0> // This is less obvious. </pre> <p> An expression like <code>5*x</code> evaluates to <code> 5*<1,0,0></code> or <code><5,0,0></code>. </p> <p> Similarly <code> u</code> and <code>v</code> may be used in 2D vectors. When using 4D vectors you should use <code>x</code>, <code>y</code>, <code> z</code>, and <code> t</code> and POV-Ray will promote <code>x</code>, <code> y</code>, and <code> z</code> to 4D when used where 4D is required. </p> <h4><a name="s03_02_01_05">3.2.1.5 </a>Specifying Colors</h4> <a name="s03_02_01_05_i1"> <pre> COLOR: COLOR_BODY | color COLOR_BODY | (this means the keyword color or colour COLOR_BODY colour may optionally precede any color specification) COLOR_BODY: COLOR_VECTOR | COLOR_KEYWORD_GROUP | COLOR_IDENTIFIER COLOR_VECTOR: rgb <3_Term_Vector> | rgbf <4_Term_Vector> | rgbt <4_Term_Vector> | [ rgbft ] <5_Term_Vector> COLOR_KEYWORD_GROUP: [ COLOR_KEYWORD_ITEM ]... COLOR_KEYWORD_ITEM: COLOR_IDENTIFIER | red Red_Amount | blue Blue_Amount | green Green_Amount | filter Filter_Amount | transmit Transmit_Amount </pre> <p class="Note"> <strong>Note:</strong> <em>COLOR_IDENTIFIERS</em> are identifiers previously declared to have color values. The 3, 4, and 5 term vectors are usually vector literals but may be vector expressions or floats promoted to vectors. See "Operator Promotion" and the sections below.<a name="s03_02_01_05_i2"><a name="color"></a><a name="s03_02_01_05_i3"><a name="colour"></a><a name="s03_02_01_05_i4"><a name="filter"></a><a name="s03_02_01_05_i5"><a name="transmit"></a> </p> <p> POV-Ray often requires you to specify a color. Colors consist of five values or color components. The first three are called <code>red</code>, <code>green</code>, and <code>blue</code>. They specify the intensity of the primary colors red, green and blue using an additive color system like the one used by the red, green and blue color phosphors on a color monitor. </p> <p> The 4th component, called <code>filter</code>, specifies the amount of filtered transparency of a substance. Some real-world examples of filtered transparency are stained glass windows or tinted cellophane. The light passing through such objects is tinted by the appropriate color as the material selectively absorbs some frequencies of light while allowing others to pass through. The color of the object is subtracted from the light passing through so this is called subtractive transparency. </p> <p> The 5th component, called <code>transmit</code>, specifies the amount of non-filtered light that is transmitted through a surface. Some real-world examples of non-filtered transparency are thin see-through cloth, fine mesh netting and dust on a surface. In these examples, all frequencies of light are allowed to pass through tiny holes in the surface. Although the amount of light passing through is diminished, the color of the light passing through is unchanged. </p> <p> The color of the object and the color transmitted through the object together contribute 100% of the final color. So if <code>transmit</code> is set to 0.9, the transmitted color contributes 90% and the color of the object contributes only 10%. This is also true outside of the 0-1 range, so for example if <code>transmit</code> is set to 1.7, the transmitted color contributes with 170% and the color of the object contributes with minus 70%. Using <code>transmit</code> values outside of the 0-1 range can be used to create interesting special effects, but does not correspond to any phenomena seen in the real world. An example: </p> <pre> #version 3.5; global_settings {assumed_gamma 1.0} camera {location -2.5*z look_at 0 orthographic} box { 0,1 texture { pigment { gradient y colour_map { [0, red 1] [1, blue 1] } } finish{ambient 1} } texture { pigment { gradient x colour_map { [0, rgb 0.5 transmit -3] [1, rgb 0.5 transmit 3] } } finish{ambient 1} } translate <-0.5,-0.5,0> scale <3,2,1> } </pre> <p> When using the <code>transmit</code> value for special effects, you can visualize it this way: The <code>transmit</code> value means "contrast". 1.0 is no change in contrast, 0.5 is half contrast, 2.0 is double contrast and so on. You could say that <code>transmit</code> "scales" the colors. The color of the object is the "center value". All colors will get closer to the "center value" if <code>transmit</code> is between 0 and 1, and all colors will spread away from the "center value" if <code>transmit</code> is greater than 1. If <code>transmit</code> is negative the colors will be inverted around the "center value". Rgb 0.5 is common to use as "center value", but other values can be used for other effects. The "center value" really is a color, and non-gray colors can be used for interesting effects. The red, green and blue components are handled separately. </p> <p class="Note"> <strong>Note:</strong> early versions of POV-Ray used the keyword <code>alpha</code> to specify filtered transparency. However that word is often used to describe non-filtered transparency. For this reason <code>alpha</code> is no longer used. </p> <p> Each of the five components of a color are float values which are normally in the range between 0.0 and 1.0. However any values, even negatives may be used. </p> <p> Under most circumstances the keyword <code>color</code> is optional and may be omitted. We also support the British or Canadian spelling <code> colour</code>. Colors may be specified using vectors, keywords with floats or identifiers. You may also create very complex color expressions from combinations of any of these using various familiar operators. The syntax for specifying a color has evolved since POV-Ray was first released. We have maintained the original keyword-based syntax and added a short-cut vector notation. Either the old or new syntax is acceptable however the vector syntax is easier to use when creating color expressions. </p> <p> The syntax for combining color literals into color expressions is almost identical to the rules for vector and float expressions. In the syntax for vector expressions, some of the syntax items are defined in the section for float expressions. See "<a href="s_97.html#s03_02_01_03">Float Expressions</a>" for those definitions. Detailed explanations of color-specific issues are given in the following sub-sections. </p> <h5><a name="s03_02_01_05_01">3.2.1.5.1 </a>Color Vectors</h5> <a name="s03_02_01_05_01_i1"><a name="s03_02_01_05_01_i2"><a name="s03_02_01_05_01_i3"><a name="rgb"></a> <p> The syntax for a color vector is... </p> <pre> COLOR_VECTOR: rgb <3_Term_Vector> | rgbf <4_Term_Vector> | rgbt <4_Term_Vector> | [ rgbft ] <5_Term_Vector> </pre> <p> ...where the vectors are any valid vector expressions of 3, 4 or 5 components. For example </p> <pre> color rgb <1.0, 0.5, 0.2> </pre> <p> This specifies a color whose red component is 1.0 or 100% of full intensity. The green component is 0.5 or 50% of full intensity and the blue component is 0.2 or 20% of full intensity. Although the filter and transmit components are not explicitly specified, they exist and are set to their default values of 0 or no transparency. </p> <p> <a name="s03_02_01_05_01_i4"><a name="rgbf"></a><a name="s03_02_01_05_01_i5"><a name="rgbt"></a><a name="s03_02_01_05_01_i6"><a name="rgbft"></a> The <code>rgbf</code> keyword requires a four component vector. The 4th component is the filter component and the transmit component defaults to zero. Similarly the <code> rgbt</code> keyword requires four components where the 4th value is moved to the 5th component which is transmit and then the filter component is set to zero. </p> <p> The <code>rgbft</code> keyword allows you to specify all five components. Internally in expressions all five are always used. </p> <p> Under some circumstances, if the vector expression is a 5 component expression or there is a color identifier in the expression then the <code> rgbtf</code> keyword is optional. </p> <h5><a name="s03_02_01_05_02">3.2.1.5.2 </a>Color Keywords</h5> <a name="s03_02_01_05_02_i1"><a name="s03_02_01_05_02_i2"><a name="s03_02_01_05_02_i3"><a name="red"></a><a name="s03_02_01_05_02_i4"><a name="green"></a><a name="s03_02_01_05_02_i5"><a name="blue"></a> <p> The older keyword method of specifying a color is still useful and many users prefer it. </p> <pre> COLOR_KEYWORD_GROUP: [ COLOR_KEYWORD_ITEM ]... COLOR_KEYWORD_ITEM: COLOR_IDENTIFIER | red Red_Amount | blue Blue_Amount | green Green_Amount | filter Filter_Amount | transmit Transmit_Amount </pre> <p> Although the <code>color</code> keyword at the beginning is optional, it is more common to see it in this usage. This is followed by any of five additional keywords <code>red</code>, <code>green</code>, <code> blue</code>, <code>filter</code>, or <code>transmit</code>. Each of these component keywords is followed by a float expression. For example </p> <pre> color red 1.0 green 0.5 </pre> <p> This specifies a color whose red component is 1.0 or 100% of full intensity and the green component is 0.5 or 50% of full intensity. Although the blue, filter and transmit components are not explicitly specified, they exist and are set to their default values of 0. The component keywords may be given in any order and if any component is unspecified its value defaults to zero. A <em>COLOR_IDENTIFIER</em> can also be specified but it should always be first in the group. See "<a href="s_97.html#s03_02_01_05_05">Common Color Pitfalls</a>" for details. </p> <h5><a name="s03_02_01_05_03">3.2.1.5.3 </a>Color Identifiers</h5> <a name="s03_02_01_05_03_i1"><a name="s03_02_01_05_03_i2"> <p> Color identifiers may be declared to make scene files more readable and to parameterize scenes so that changing a single declaration changes many values. An identifier is declared as follows. </p> <pre> COLOR_DECLARATION: #declare IDENTIFIER = COLOR; | #local IDENTIFIER = COLOR; </pre> <p> Where <em>IDENTIFIER</em> is the name of the identifier up to 40 characters long and <em>COLOR</em> is any valid specification. </p> <p class="Note"> <strong>Note:</strong> there should be a semi-colon at the end of the declaration. If omitted, it generates a warning and some macros may not work properly. See " <a href="s_98.html#s03_02_02_02_02">#declare vs. #local</a>" for information on identifier scope. </p> <p> Here are some examples.... </p> <pre> #declare White = rgb <1,1,1>; #declare Cyan = color blue 1.0 green 1.0; #declare Weird = rgb <Foo*2,Bar-1,Bob/3>; #declare LightGray = White*0.8; #declare LightCyan = Cyan red 0.6; </pre> <p> As the <code>LightGray</code> example shows you do not need any color keywords when creating color expressions based on previously declared colors. The last example shows you may use a color identifier with the keyword style syntax. Make sure that the identifier comes first before any other component keywords. </p> <p> Like floats and vectors, you may re-define colors throughout a scene but the need to do so is rare. </p> <h5><a name="s03_02_01_05_04">3.2.1.5.4 </a>Color Operators</h5> <a name="s03_02_01_05_04_i1"><a name="s03_02_01_05_04_i2"><a name="s03_02_01_05_04_i3"><a name="gray"></a> <p> Color vectors may be combined in expressions the same as float or vector values. Operations are performed on a component by component basis. For example <code>rgb <1.0,0.5,0.2>*0.9</code> evaluates the same as <code> rgb<1.0,0.5,0.2>*<0.9,0.9,0.9></code> or <code> rgb<0.9,0.45,0.18></code>. Other operations are done on a similar component by component basis. </p> <p> You may use the dot operator to extract a single component from a color. Suppose the identifier <code>Shade</code> was previously defined as a color. Then <code>Shade.red</code> is the float value of the red component of <code> Shade</code>. Similarly <code> Shade.green</code>, <code>Shade.blue</code>, <code>Shade.filter</code> and <code>Shade.transmit</code> extract the float value of the other color components. <code>shade.gray</code> returns the gray value of the color vector. </p> <h5><a name="s03_02_01_05_05">3.2.1.5.5 </a>Common Color Pitfalls</h5> <a name="s03_02_01_05_05_i1"><a name="s03_02_01_05_05_i2"> <p> The variety and complexity of color specification methods can lead to some common mistakes. Here are some things to consider when specifying a color. </p> <p> When using filter transparency, the colors which come through are multiplied by the primary color components. For example if gray light such as <code> rgb<0.9,0.9,0.9></code> passes through a filter such as <code> rgbf<1.0,0.5,0.0,1.0></code> the result is <code> rgb<0.9,0.45,0.0></code> with the red let through 100%, the green cut in half from 0.9 to 0.45 and the blue totally blocked. Often users mistakenly specify a clear object by </p> <pre> color filter 1.0 </pre> <p> but this has implied red, green and blue values of zero. You have just specified a totally black filter so no light passes through. The correct way is either </p> <pre> color red 1.0 green 1.0 blue 1.0 filter 1.0 </pre> <p> or </p> <pre> color transmit 1.0 </pre> <p> In the 2nd example it does not matter what the rgb values are. All of the light passes through untouched. Another pitfall is the use of color identifiers and expressions with color keywords. For example... </p> <pre> color My_Color red 0.5 </pre> <p> this substitutes whatever was the red component of <code>My_Color</code> with a red component of 0.5 however... </p> <pre> color My_Color + red 0.5 </pre> <p> adds 0.5 to the red component of <code>My_Color</code> and even less obvious... </p> <pre> color My_Color * red 0.5 </pre> <p> that cuts the red component in half as you would expect but it also multiplies the green, blue, filter and transmit components by zero! The part of the expression after the multiply operator evaluates to <code> rgbft<0.5,0,0,0,0></code> as a full 5 component color. </p> <p> The following example results in no change to <code>My_Color</code>. </p> <pre> color red 0.5 My_Color </pre> <p> This is because the identifier fully overwrites the previous value. When using identifiers with color keywords, the identifier should be first. Another issue to consider: some POV-Ray syntax allows full color specifications but only uses the rgb part. In these cases it is legal to use a float where a color is needed. For example: </p> <pre> finish { ambient 1 } </pre> <p> The <a href="#l60">ambient</a> keyword expects a color so the value <code>1</code> is promoted to <code><1,1,1,1,1></code> which is no problem. However </p> <pre> pigment { color 0.4 } </pre> <p> is legal but it may or may not be what you intended. The <code> 0.4</code> is promoted to <code><0.4,0.4,0.4,0.4,0.4></code> with the filter and transmit set to 0.4 as well. It is more likely you wanted... </p> <pre> pigment { color rgb 0.4 } </pre> <p> in which case a 3 component vector is expected. Therefore the <code> 0.4</code> is promoted to <code><0.4,0.4,0.4,0.0,0.0></code> with default zero for filter and transmit. Finally there is another problem which arises when using color dot operators in <code>#declare</code> or <code> #local</code> directives. Consider the directive: </p> <pre> #declare MyColor = rgb <0.75, 0.5, 0.75>; #declare RedAmt = MyColor.red; </pre> <p> Now <code>RedAmt</code> should be a float but unfortunately it is a color. POV-Ray looks at the first keyword after the equals to try to guess what type of identifier you want. It sees the color identifier <code> MyColor</code> and assumes you want to declare a color. It then computes the float value as 0.75 then promotes that into <code> rgbft<0.75,0.75,0.75,0.75,0.75></code>. It would take a major rewrite to fix this problem so we are just warning you about it. Any of the following work-arounds will work properly. </p> <pre> #declare RedAmt = 0.0+MyColor.red; #declare RedAmt = 1.0*MyColor.red; #declare RedAmt = (MyColor.red); </pre> <h4><a name="s03_02_01_06">3.2.1.6 </a>User-Defined Functions</h4> <a name="s03_02_01_06_i1"><a name="Functions, user-defined"></a><a name="s03_02_01_06_i2"><a name="Functions"></a><a name="s03_02_01_06_i3"><a name="function"></a> <p> Some objects allow you to specify functions that will be evaluated while rendering to determine the surface of these objects. In this respect functions are quite different to <a href="#l118">macros</a>, which are evaluated at parse time but do not otherwise affect rendering. Additionally you may call these functions anywhere a Float Function is allowed, even during parsing. The syntax is identical to Float Expressions, however, only float functions that apply to float values may be used. Excluded are for example <code><a href="s_97.html#s03_02_01_03_04">strlen</a></code> or <code><a href="s_97.html#s03_02_01_03_04">vlength</a></code>. You find a full list of supported float functions in the syntax definition below. </p> <pre> FLOAT: LOGIC_AND [OR LOGIC_AND] OR: | LOGIC_AND: REL_TERM [AND REL_TERM] AND: & REL_TERM: TERM [REL_OPERATOR TERM] REL_OPERATOR: < | <= | >= | > | = | != TERM: FACTOR [SIGN FACTOR] SIGN: + | - FACTOR: MOD_EXPRESSION [MULT MOD_EXPRESSION] MULT: * | / EXPRESSION: FLOAT_LITERAL | FLOAT_IDENTIFIER | FLOAT_FUNCTION | FLOAT_BUILT-IN_IDENT | FUNCTION_IDENTIFIER | ( FLOAT ) | IDENTIFIER | SIGN EXPRESSION FLOAT_FUNCTION: abs( FLOAT ) | acos( FLOAT ) | acosh( FLOAT ) | asin( FLOAT ) | asinh( FLOAT ) | atan( FLOAT) | atanh( FLOAT) | atan2( FLOAT , FLOAT ) | ceil( FLOAT ) | cos( FLOAT ) | cosh( FLOAT ) | degrees( FLOAT ) | exp( FLOAT ) | floor( FLOAT ) | int( FLOAT ) | ln (Float) | log( FLOAT ) | max( FLOAT , FLOAT, ... ) | min( FLOAT , FLOAT, ... ) | mod( FLOAT , FLOAT ) | pow( FLOAT , FLOAT ) | radians( FLOAT ) | sin( FLOAT ) | sinh( FLOAT ) | sqrt( FLOAT ) | tan( FLOAT ) | tanh( FLOAT ) | select( FLOAT , FLOAT , FLOAT [, FLOAT] ) FUNCTION_IDENTIFIER: #local FUNCTION_IDENTIFIER = function { FLOAT } | #declare FUNCTION_IDENTIFIER = function { FLOAT } | #local FUNCTION_IDENTIFIER = function(IDENT_LIST) { FLOAT } | #declare FUNCTION_IDENTIFIER = function(IDENT_LIST) { FLOAT } | #local FUNCTION_IDENTIFIER = function{SPECIAL_FLOAT_FUNCTION} | #local VECTOR_IDENTIFIER = function{SPECIAL_VECTOR_FUNCTION} | #local COLOR_IDENTIFIER = function { SPECIAL_COLOR_FUNCTION } | IDENT_LIST: IDENT_ITEM [, IDENT_LIST] IDENT_ITEM: x | y | z | u | v | IDENTIFIER (Note: x = u and y = v) SPECIAL_FLOAT_FUNCTION: pattern { PATTERN_BLOCK } SPECIAL_VECTOR_FUNCTION: TRANSFORMATION_BLOCK | SPLINE SPECIAL_COLOR_FUNCTION: PIGMENT PATTERN_BLOCK: PATTERN </pre> <p class="Note"> <strong>Note:</strong> Only the above mentioned items can be used in user-defined functions. For example the rand() function is not available. </p> <p> All of the above mentioned float functions are described in the section <a href="s_97.html#s03_02_01_03_04">Float Functions</a>. </p> <h5><a name="s03_02_01_06_01">3.2.1.6.1 </a>Sum and Product functions</h5> <a name="s03_02_01_06_01_i1"><a name="prod"></a> <p> <code>prod(i, b, n, a)</code> The product function. </p> <p> <br><center><img alt="product function" src="images/reference/prod.png"></center><a name="s03_02_01_06_01_i2"><a name="sum"></a> </p> <p> <code>sum(i, b, n, a)</code> The sum function. </p> <p> <br><center><img alt="sum function" src="images/reference/sum.png"></center> </p> <p> For both <code>prod</code> and <code>sum</code>: <code>i</code> is any variable name and <code>a</code> is any expression, usually depending on <code>i</code>. <code>b</code> and <code>n</code> are also any expression. <br>Example: </p> <pre> #declare factorial = function(C) { prod(i, 1, C, i) } #declare A = factorial(5); </pre> <p> The first parameter is the name of the iteration variable. The second is the initial value expression and the third is the final value expression. Those may not depend on the iteration variable but the iteration variable may still be used inside those two expressions (because it happens to already have been defined) but its value is undefined. The last expression is the actual expression which will be iterated through. It may use any variable in scope. </p> <p> The scope of an iteration variable is the sequence operation function. That is, a iteration variable is only defined when used inside the <code>sum/prod</code> function. Of course <code>sum/prod</code> functions may be nested. However, there is one limit of a maximum of 56 local variable defined simultaneously, which essentially means that in any combination <code>sum/prod</code> functions cannot be nested deeper than 56 levels. </p> <p> The iteration variable is incremented by one for each step, but its initial and final value may be any value. The iteration will be continued as long as the iteration value is less or equal to the final value. </p> <p class="Note"> <strong>Note:</strong> because the iteration value is a floating-point variable, adding one will add a certain bias in a long iterations and thus the floating-point precision will be an issue in such a case and needs to be considered by allowing a reasonable error for the final value! </p> <p> If the expression to be added has a negative sign it will of course in effect be substracted. Thus changing the sign will allow to generate negative values in the sum function. Equally multiplying by <code>1/expression</code> effectively creates a division when used in the prod function. </p> <p> Obviously to work in the first place the initial value of the result is the neutral element of the operation. That is, a sum calculation starts with <code>0</code> and a product calculation starts with <code>1</code> just like it is assumed in the sum and product functions in 'regular' math. </p> <p> It should be noted that mathematically either sum or product are redundant because: </p> <pre> log10(prod(i, b, n, a)) = sum(i, b, n, log10(a)) </pre> <p> which implies a sum can be represented as a product and vice versa, observing the usual mathematical constraints of logarithms, of course. However, as logarithms and their inverse (powers) are slow to compute both are provided... </p> <h5><a name="s03_02_01_06_02">3.2.1.6.2 </a>Functions and Macros</h5> <a name="s03_02_01_06_02_i1"><a name="Functions, vs. macros"></a><a name="s03_02_01_06_02_i2"><a name="Macros, vs. functions"></a> <p> You can use macros in functions, but the macros will be called only once when the function is defined, not every time the function is called. You cannot pass function variables to the macros. </p> <p> You can pass functions to macros, how to do this is best explained by an example: </p> <pre> #macro Foo( Bar, X ) #declare Y = Bar(X); #declare Z = Bar(Y); #end #declare FUNC=function(n){n+2} Foo(FUNC, 1) #debug str(Y,5,5) #debug "n" #debug str(Z,5,5) #debug "n" </pre> <h5><a name="s03_02_01_06_03">3.2.1.6.3 </a>Declaring User-Defined Float Functions</h5> <a name="s03_02_01_06_03_i1"><a name="s03_02_01_06_03_i2"> <p> You declare a user defined function using the <code>#declare</code> or <code>#local</code> directives. By default a function takes three parameters and you do not have to explicitly specify the parameter names. The default three parameters are <code>x</code>, <code>y</code> and <code>z</code>. For example: </p> <pre> #declare foo = function { x + y * z } </pre> <p> If you need fewer or more parameters you have to explicitly specify the parameter list. </p> <p class="Note"> <strong>Note:</strong> <code>x</code> and <code>u</code> as well as <code>y</code> and <code>v</code> are equivalent so you may not specify both parameter names. You may not specify two or more parameters with the same name either. Doing so may result in a parse error or undefined function results. </p> <p> The following are valid functions with parameters: </p> <pre> #declare foo2 = function(x, y, z) { x + y * z } #declare foo3 = function(k1, k2, z, y) { x + y * z + k1 * y + k2 } #declare foo4 = function(h) { h * h + h } #declare foo4 = function(u, v) { x + y * v } //=u + v*v #declare foo4 = function(x, v, z) { u + y * v + z } //=x + v*v + z </pre> <p> <strong>Limits:</strong> </p> <ul> <li> The minimum number of parameters per function is 1. </li> <li> The maximum number of allowed parameters per function is 56. </li> <li> The maximum number of <code>function</code> blocks per scene is 1048575. </li> <li> The maximum number of operators per function is about 200000. Individual limits will be different depending on the types of operators used in the function. </li> <li> The maximum depth for nesting functions is 1024. </li> <li> The maximum number of constants in all functions 1048575. </li> </ul> <p class="Note"> <strong>Note:</strong> Redeclaring functions, directly, is not allowed. The way to do this is to <code>undef</code> it first.<a name="s03_02_01_06_03_i3"><a name="pattern"></a> </p> <p> There is one special float function type. You may declare a <code>pattern</code> function. </p> <p class="Note"> <strong>Note:</strong> the syntax is identical to that of patterns, however, you may not specify colors. Its result is always a float and not a color vector, as returned by a function containing a pigment. </p> <pre> #declare foo = function { pattern { checker } } </pre> <p class="Note"> <strong>Note:</strong> the number of parameters of special function types is determined automatically, so you do not need to specify parameter names. </p> <h5><a name="s03_02_01_06_04">3.2.1.6.4 </a>Declaring User-Defined Vector Functions</h5> <a name="s03_02_01_06_04_i1"><a name="s03_02_01_06_04_i2"> <p> Right now you may only declare vector functions using one of the special function types. Supported types are <code>transform</code> and <code>spline</code> functions. For example: </p> <pre> #declare foo = function { transform { rotate <90, 0, 0> scale 4 } } #declare myvector = foo(4, 3, 7); #declare foo2 = function { spline { linear_spline 0.0, <0,0,0> 0.5, <1,0,0> 1.0, <0,0,0> } } #declare myvector2 = foo2(0.7); </pre> <p> Function splines take the vector size into account. That is, a function containing a spline with five components will also return a five component vector (aka a color), a function containing a spline with two components will only return a two component vector and so on. </p> <p class="Note"> <strong>Note:</strong> the number of parameters of special function types is determined automatically, so you do not need to specify parameter names. </p> <h5><a name="s03_02_01_06_05">3.2.1.6.5 </a>Declaring User-Defined Color Functions</h5> <a name="s03_02_01_06_05_i1"><a name="s03_02_01_06_05_i2"> <p> Right now you may only declare color functions using one of the special function types. The only supported type is the <code>pigment</code> function. You may use every valid <code>pigment</code>. This is a very simple example: </p> <pre> #declare foo = function { pigment { color red 1 } } #declare Vec = foo(1,2,3) </pre> <p> An example using a pattern: </p> <pre> #declare foo = function { pigment { crackle color_map { [0.3, color Red] [1.0, color Blue] } } } #declare Val = foo(2,3,4).gray </pre> <p class="Note"> <strong>Note:</strong> the number of parameters of special function types is determined automatically, so you do not need to specify parameter names. </p> <h5><a name="s03_02_01_06_06">3.2.1.6.6 </a>Internal Pre-Defined Functions</h5> <a name="s03_02_01_06_06_i1"><a name="s03_02_01_06_06_i2"><a name="internal"></a> <p> Several functions are pre-defined. These internal functions can be accessed through the <a href="s_138.html#s03_07_07">"functions.inc"</a>, so it should be included in your scene. <br>The number of required parameters and what they control are also given in the include file, but the <a href="s_138.html#s03_07_07">"functions.inc"</a> chapter in the "Standard Include File" section gives more information. </p> <h4><a name="s03_02_01_07">3.2.1.7 </a>Strings</h4> <a name="s03_02_01_07_i1"><a name="Strings"></a> <p> The POV-Ray language requires you to specify a string of characters to be used as a file name, text for messages or text for a text object. Strings may be specified using literals, identifiers or functions which return string values. See "<a href="s_97.html#s03_02_01_07_03">String Functions</a>" for details on string functions. Although you cannot build string expressions from symbolic operators such as are used with floats, vectors or colors, you may perform various string operations using string functions. Some applications of strings in POV-Ray allow for non-printing formatting characters such as newline or form-feed. </p> <pre> STRING: STRING_FUNCTION | STRING_IDENTIFIER | STRING_LITERAL STRING_LITERAL: "up to 256 ASCII characters" STRING_FUNCTION: str( FLOAT , INT , INT ) | concat( STRING , STRING , [STRING ,...]) | chr( INT ) | substr( STRING , INT , INT ) | strupr( STRING ) | strlwr( STRING ) | vstr( INT, VECTOR, STRING, INT, INT ) </pre> <h5><a name="s03_02_01_07_01">3.2.1.7.1 </a>String Literals</h5> <a name="s03_02_01_07_01_i1"><a name="s03_02_01_07_01_i2"><a name="s03_02_01_07_01_i3"> <p> String literals begin with a double quote mark '"' which is followed by up to 256 characters and are terminated by another double quote mark. You can change the character set of strings using the <code><a href="#l75">global_settings</a></code> <code><a href="s_102.html#s03_03_03_06">charset</a></code> option. The following are all valid string literals: </p> <p> "Here" "There" "myfile.gif" "textures.inc" </p> <p class="Note"> <strong>Note:</strong> if you need to specify a quote mark in a string literal you must precede it with a backslash. </p> <p> Example </p> <pre> "Joe said \"Hello\" as he walked in."</pre> <p> is converted to </p> <pre> Joe said "Hello" as he walked in.</pre> <p> If you need to specify a backslash, you will have to specify two. For example: </p> <pre> "This is a backslash \\ and this is two \\\\"</pre> <p> Is converted to: </p> <pre>This is a backslash \ and this is two \\</pre> <p> Windows users need to be especially wary about this as the backslash is also the windows path separator. For example, the following code does not produce the intended result: </p> <pre> #declare DisplayFont = "c:\windows\fonts\lucon.ttf" text { ttf DisplayFont "Hello", 2,0 translate y*1.50 } </pre> <p> New users might expect this to create a text object using the font "c:\windows\fonts\lucon.ttf". Instead, it will give an error message saying that it cannot find the font file "c:windowsontslucon.ttf". </p> <p> The correct form of the above code is as follows: </p> <pre> #declare DisplayFont = "c:\\windows\\fonts\\lucon.ttf" text { ttf DisplayFont "Hello", 2,0 translate y*1.50 } </pre> <p> The escaping of backslashes occurs in all POV-Ray string literals. There are also other formatting codes such as <code>\n</code> for new line. See "<a href="s_98.html#s03_02_02_07_02">Text Formatting</a>" for details. </p> <h5><a name="s03_02_01_07_02">3.2.1.7.2 </a>String Identifiers</h5> <a name="s03_02_01_07_02_i1"><a name="s03_02_01_07_02_i2"> <p> String identifiers may be declared to make scene files more readable and to parameterize scenes so that changing a single declaration changes many values. An identifier is declared as follows. </p> <pre> STRING_DECLARATION: #declare IDENTIFIER = STRING | #local IDENTIFIER = STRING </pre> <p> Where <em>IDENTIFIER</em> is the name of the identifier up to 40 characters long and <em>STRING</em> is any valid string specification. </p> <p class="Note"> <strong>Note:</strong> unlike floats, vectors, or colors, there need not be a semi-colon at the end of the declaration. See "<a href="s_98.html#s03_02_02_02_02">#declare vs. #local</a>" for information on identifier scope. </p> <p> Here are some examples... </p> <pre> #declare Font_Name = "ariel.ttf" #declare Inc_File = "myfile.inc" #declare Name = "John" #declare Name = concat(Name," Doe") </pre> <p> As the last example shows, you can re-declare a string identifier and may use previously declared values in that re-declaration. </p> <h5><a name="s03_02_01_07_03">3.2.1.7.3 </a>String Functions</h5> <a name="s03_02_01_07_03_i1"><a name="s03_02_01_07_03_i2"> <p> POV-Ray defines a variety of built-in functions for manipulating floats, vectors and strings. Function calls consist of a keyword which specifies the name of the function followed by a parameter list enclosed in parentheses. Parameters are separated by commas. For example: </p> <pre> keyword(param1,param2) </pre> <p> The following are the functions which return string values. They take one or more float, integer, vector, or string parameters. Assume that <code> A</code> is any valid expression that evaluates to a float; <code> B</code>, <code>L</code>, and <code>P</code> are floats which are truncated to integers internally, <code>S</code>, <code>S1</code>, <code>S2</code> etc are strings.<a name="s03_02_01_07_03_i3"><a name="chr"></a> </p> <p> <code>chr(B)</code> Character whose character value is <code>B</code>. Returns a single character string. The character value of the character is specified by an integer <code>B</code> which must be in the range 0 to 65535 if you specified <code>charset utf8</code> in the <code>global_settings</code> and 0 to 127 if you specified <code>charset ascii</code>. Refer to your platform specific documentation if you specified <code>charset sys</code>. For example <code>chr(70)</code> is the string "F". When rendering text objects you should be aware that the characters rendered are dependent on the (TTF) font being used. </p> <p> <a name="s03_02_01_07_03_i4"><a name="concat"></a> <code> concat(S1,S2,...)</code> Concatenate strings <code>S1</code> and <code> S2</code>. Returns a string that is the concatenation of all parameter strings. Must have at least 2 parameters but may have more. For example: </p> <pre> concat("Value is ", str(A,3,1), " inches") </pre> <p> If the float value <code>A</code> was <code>12.34321</code> the result is <code>"Value is 12.3 inches"</code> which is a string.<a name="s03_02_01_07_03_i5"><a name="str"></a> </p> <p> <code> str(A,L,P):</code> Convert float A to a formatted string. Returns a formatted string representation of float value <code>A</code>. The integer parameter <code>L</code> specifies the minimum length of the string and the type of left padding used if the string's representation is shorter than the minimum. If <code>L</code> is positive then the padding is with blanks. If <code>L</code> is negative then the padding is with zeros. The overall minimum length of the formatted string is <em>abs(L)</em>. If the string needs to be longer, it will be made as long as necessary to represent the value. </p> <p> The integer parameter <code>P</code> specifies the number of digits after the decimal point. If <code>P</code> is negative then a compiler-specific default precision is use. Here are some examples: </p> <pre> str(123.456, 0, 3) "123.456" str(123.456, 4, 3) "123.456" str(123.456, 9, 3) " 123.456" str(123.456,-9, 3) "00123.456" str(123.456, 0, 2) "123.46" str(123.456, 0, 0) "123" str(123.456, 5, 0) " 123" str(123.000, 7, 2) " 123.00" str(123.456, 0,-1) "123.456000" (platform specific) </pre> <a name="s03_02_01_07_03_i6"><a name="strlwr"></a> <p> <code>strlwr(S)</code> Lower case of <code>S</code>. Returns a new string in which all upper case letters in the string S1 are converted to lower case. The original string is not affected. For example <code> strlwr("Hello There!")</code> results in "hello there!". </p> <p> <a name="s03_02_01_07_03_i7"><a name="substr"></a> <code> substr(S,P,L)</code> Sub-string from <code>S</code>. Returns a string that is a subset of the characters in parameter <code> S</code> starting at the position specified by the integer value <code> P</code> for a length specified by the integer value <code>L</code>. For example <code> substr("ABCDEFGHI",4,2)</code> evaluates to the string "DE". If <em>P+L-1>strlen(S)</em> an error occurs. </p> <p> <a name="s03_02_01_07_03_i8"><a name="strupr"></a> <code> strupr(S)</code> Upper case of <code>S</code>. Returns a new string in which all lower case letters in the string <code>S</code> are converted to upper case. The original string is not affected. For example <code> strupr("Hello There!")</code> results in "HELLO THERE!".<a name="s03_02_01_07_03_i9"><a name="vstr"></a> </p> <p> <code>vstr(N,A,S,L,P)</code> Convert vector A to a formatted string. Returns a formatted string representation of vector <code>A</code> where the elements of the vector are separated by the string parameter <code>S</code>. The integer parameter <code>N</code> specifies the amount of dimensions in vector <code>A</code>. <code>N</code> is autoclipped to the range of 2 to 5, without warning. Specifying a vector <code>A</code> with more dimensions than given by <code>N</code> will result in an error.<br> The integer parameter <code>L</code> specifies the minimum length of the string and the type of left padding used if the string's representation is shorter than the minimum. The integer parameter <code>P</code> specifies the number of digits after the decimal point. If <code>P</code> is negative then a compiler-specific default precision is use. The function of <code>L</code> and <code>P</code> is the same as in <code>str</code>. Here are some examples: </p> <pre> vstr(2, <1,2>, ", ", 0,1) "1.0, 2.0" vstr(5, <1,2,3,4,5>, ", ", 0,1) "1.0, 2.0, 3.0, 4.0, 5.0" vstr(1, 1, ", ", 0,1) "1.0, 1.0" vstr(2, 1, ", ", 0,1) "1.0, 1.0" vstr(5, 1, ", ", 0,1) "1.0, 1.0, 1.0, 1.0, 1.0" vstr(7, 1, ", ", 0,1) "1.0, 1.0, 1.0, 1.0, 1.0" vstr(3, <1,2>, ", ", 0,1) "1.0, 2.0, 0.0" vstr(5, <1,2,3>, ", ", 0,1) "1.0, 2.0, 3.0, 0.0, 0.0" vstr(3, <1,2,3,4>, ", ", 0,1) error </pre> <p> See section "<a href="s_97.html#s03_02_01_03_04">Float Functions</a>" for other functions which are somewhat string-related but which return floats. In addition to the above built-in functions, you may also define your own functions using the <code><a href="#l119">#macro</a></code> directive. See the section "<a href="s_98.html#s03_02_02_08">User Defined Macros</a>" for more details. </p> <h4><a name="s03_02_01_08">3.2.1.8 </a>Array Identifiers</h4> <a name="s03_02_01_08_i1"><a name="s03_02_01_08_i2"><a name="s03_02_01_08_i3"><a name="array"></a> <p> You may declare arrays of identifiers of up to five dimensions. Any item that can be declared as an identifier can be declared in an array. </p> <h5><a name="s03_02_01_08_01">3.2.1.8.1 </a>Declaring Arrays</h5> <a name="s03_02_01_08_01_i1"><a name="s03_02_01_08_01_i2"> <p> The syntax for declaring an array is as follows: </p> <pre> ARRAY_DECLARATION: #declare IDENTIFIER = array[ INT ][[ INT ]]..[ARRAY_INITIALIZER] | #local IDENTIFIER = array[ INT ][[ INT ]]..[ARRAY_INITIALIZER] ARRAY_INITIALIZER: {ARRAY_ITEM, [ARRAY_ITEM, ]... } ARRAY_ITEM: RVALUE | ARRAY_INITIALIZER </pre> <p> Where IDENTIFIER is the name of the identifier up to 40 characters long and INT is a valid float expression which is internally truncated to an integer which specifies the size of the array. The optional <em> ARRAY_INITIALIZER</em> is discussed in the next section "<a href="s_97.html#s03_02_01_08_02">Array Initializers</a>". Here is an example of a one-dimensional, uninitialized array. </p> <pre> #declare MyArray = array[10] </pre> <p> This declares an uninitialized array of ten elements. The elements are referenced as <code>MyArray[0]</code> through <code>MyArray[9]</code>. As yet, the type of the elements are undetermined. Once you have initialized any element of the array, all other elements can only be defined as that type. An attempt to reference an uninitialized element results in an error. For example: </p> <pre> #declare MyArray = array[10] #declare MyArray[5] = pigment{White} //all other elements must //be pigments too. #declare MyArray[2] = normal{bumps 0.2} //generates an error #declare Thing = MyArray[4] //error: uninitialized array element </pre> <p> Multi-dimensional arrays up to five dimensions may be declared. For example: </p> <pre> #declare MyGrid = array[4][5] </pre> <p> declares a 20 element array of 4 rows and 5 columns. Elements are referenced from <code>MyGrid[0][0]</code> to <code>MyGrid[3][4]</code>. Although it is permissible to reference an entire array as a whole, you may not reference just one dimension of a multi-dimensional array. For example: </p> <pre> #declare MyArray = array[10] #declare MyGrid = array[4][5] #declare YourArray = MyArray //this is ok #declare YourGrid = MyGrid //so is this #declare OneRow = MyGrid[2] //this is illegal </pre> <p> The <code><a href="s_98.html#s03_02_02_06_02">#ifdef</a></code> and <code><a href="s_98.html#s03_02_02_06_02">#ifndef</a></code> directives can be used to check whether a specific element of an array has been declared. For methods to determine the size of an array look in the float section for <code><a href="s_97.html#s03_02_01_03_04">dimensions</a></code> and <code><a href="s_97.html#s03_02_01_03_04">dimension_size</a></code> </p> <p> Large uninitialized arrays do not take much memory. Internally they are arrays of pointers so they probably use just 4 bytes per element. Once initialized with values, they consume memory depending on what you put in them. </p> <p> The rules for local vs. global arrays are the same as any other identifier. </p> <p class="Note"> <strong>Note:</strong> this applies to the entire array. You cannot mix local and global elements in the same array. See "<a href="s_98.html#s03_02_02_02_02">#declare vs. #local</a>" for information on identifier scope. </p> <h5><a name="s03_02_01_08_02">3.2.1.8.2 </a>Array Initializers</h5> <a name="s03_02_01_08_02_i1"><a name="s03_02_01_08_02_i2"> <p> Because it is cumbersome to individually initialize the elements of an array, you may initialize it as it is created using array initializer syntax. For example: </p> <pre> #include "colors.inc" #declare FlagColors = array[3] {Red,White,Blue} </pre> <p> Multi-dimensional arrays may also be initialized this way. For example: </p> <pre> #declare Digits = array[4][10] { {7,6,7,0,2,1,6,5,5,0}, {1,2,3,4,5,6,7,8,9,0}, {0,9,8,7,6,5,4,3,2,1}, {1,1,2,2,3,3,4,4,5,5} } </pre> <p> The commas are required between elements and between dimensions as shown in the example. </p> <h4><a name="s03_02_01_09">3.2.1.9 </a>Spline Identifiers</h4> <a name="s03_02_01_09_i1"><a name="spline"></a> <p> Splines give you a way to define 'pathways' through your scenes. You specify a series of points, and POV-Ray interpolates to make a curve connecting them. Every point along the spline has a numerical value. A good example of a spline is the path of a moving object: the spline itself would be the path traced out by the object and the 'parameter' would be time; as time changes the object's position moves along the spline. <br>Therefore, given a time reference you could use this spline to find the position of the object. In fact, splines are very well suited to animation. </p> <p> The syntax is: </p> <pre> SPLINE_DECLARATION: #declare IDENTIFIER = spline { [SPLINE_IDENTIFIER] | [SPLINE_TYPE] | [Val_1, <Point_1>[,] Val_2, <Point_2>[,] ... Val_n, <Point_n>] } SPLINE_TYPE: linear_spline | quadratic_spline | cubic_spline | natural_spline SPLINE_USAGE: MySpline(Val) | MySpline(Val, SPLINE_TYPE) </pre> <p> The first item gives the type of interpolation. <br>In a <code>linear_spline</code>, straight lines connect each point. <br>In a <code>quadratic_spline</code>, a smooth curve defined by a second-order polynomial connects each point. <a name="s03_02_01_09_i2"><a name="natural_spline"></a> <br>In <code>cubic_spline</code> and <code>natural_spline</code>, a smooth curve defined by a third-order polynomial connects each point. <br>The default is <code>linear_spline</code>. </p> <p> Following this are a number of float values each followed by a position vector, all separated by commas. <code>Val_1</code>, <code>Val_2</code>, etc, are the value of the spline parameter at each specific point. The points need not be in order of their parameter values. If two points have the same parameter value, the second point will replace the first. Beyond the range of the lowest and highest parameter values, the spline position is fixed at the endpoints. </p> <p class="Note"> <strong>Note:</strong> Because of the way cubic_splines are defined: the first and last points are tangents rather than points on the spline, cubic_spline interpolation is only valid between the second and next-to-last points. For all other spline types, interpolation is valid from the first point to the last point. For t-values outside the valid range, POV-Ray returns the value of the nearest valid point. </p> <p> To use a spline, you place the spline identifier followed by the parameter (in parentheses) wherever you would normally put a vector, similar to a macro. Splines behave mostly like three-dimensional vectors. <br>Here is an example: </p> <pre> camera { location <0,2,-2> look_at 0 } light_source { <-5,30,-10> 1 } #declare MySpline = spline { cubic_spline -.25, <0,0,-1> 0.00, <1,0,0> 0.25, <0,0,1> 0.50, <-1,0,0> 0.75, <0,0,-1> 1.00, <1,0,0> 1.25, <0,0,1> } #declare ctr = 0; #while (ctr < 1) sphere { MySpline(ctr),.25 pigment { rgb <1-ctr,ctr,0> } } #declare ctr = ctr + 0.01; #end </pre> <p> You can also have POV-Ray evaluate a spline as if it were a different type of spline by specifying the type of spline after the value to interpolate at, for example:<br> </p> <pre> sphere{ <2,0,2>, .25 pigment{rgb MySpline(clock, linear_spline)}} </pre> <p> Splines are 'intelligent' when it comes to returning vectors. The vector with the most components in the spline determines the size of the returned vector. This allows vectors from two to five components to be returned by splines. </p> <p> Also, function splines take the vector size into account. That is, a function containing a spline with five components will also return a five component vector (aka a color), a function containing a spline with two components will only return a two component vector and so on. </p> <h5><a name="s03_02_01_09_01">3.2.1.9.1 </a>Splines and Macros</h5> <a name="s03_02_01_09_01_i1"><a name="Splines, vs. macros"></a><a name="s03_02_01_09_01_i2"><a name="Macros, vs. splines"></a> <p> You can pass functions to macros, how to do this is best explained by an example </p> <pre> #macro Foo( Bar, Val ) #declare Y = Bar(Val).y; #end #declare myspline = spline { 1, <4,5> 3, <5,5> 5, <6,5> } Foo(myspline, 2) #debug str(Y,5,5) #debug "\n" </pre> <p> <a name="l58"> <small><strong>More about "absorption"</strong></small> </a> <ul> <li><small> <a href="s_129.html#s03_06_02_01_01">3.6.2.1.1 Absorption</a> in 3.6.2.1 Media Types </small> <li><small> <a href="s_129.html#s03_06_02_01_03">3.6.2.1.3 Scattering</a> in 3.6.2.1 Media Types </small> </ul> </p> <p> <a name="l59"> <small><strong>More about "acos"</strong></small> </a> <ul> <li><small> <a href="s_140.html#s03_07_09_01">3.7.9.1 Float functions and macros</a> in 3.7.9 math.inc </small> <li><small> <a href="s_97.html#s03_02_01_03_04">3.2.1.3.4 Functions</a> in 3.2.1.3 Float Expressions </small> </ul> </p> <p> <a name="l60"> <small><strong>More about "ambient"</strong></small> </a> <ul> <li><small> <a href="s_117.html#s03_05_03">3.5.3 Finish</a> in 3.5 Textures </small> <li><small> <a href="s_117.html#s03_05_03_01">3.5.3.1 Ambient</a> in 3.5.3 Finish </small> </ul> </p> <p> <a name="l61"> <small><strong>More about "angle"</strong></small> </a> <ul> <li><small> <a href="s_100.html#s03_03_01_01_03">3.3.1.1.3 Angles</a> in 3.3.1.1 Placing the Camera </small> <li><small> <a href="s_140.html#s03_07_09_02">3.7.9.2 Vector functions and macros</a> in 3.7.9 math.inc </small> </ul> </p> <p> <a name="l62"> <small><strong>More about "array"</strong></small> </a> <ul> <li><small> <a href="s_155.html#s03_08_03_06">3.8.3.6 Arrays</a> in 3.8.3 Language Basics </small> <li><small> <a href="s_97.html#s03_02_01_08">3.2.1.8 Array Identifiers</a> in 3.2.1 Language Basics </small> </ul> </p> <p> <a name="l63"> <small><strong>More about "asin"</strong></small> </a> <ul> <li><small> <a href="s_140.html#s03_07_09_01">3.7.9.1 Float functions and macros</a> in 3.7.9 math.inc </small> <li><small> <a href="s_97.html#s03_02_01_03_04">3.2.1.3.4 Functions</a> in 3.2.1.3 Float Expressions </small> </ul> </p> <p> <a name="l64"> <small><strong>More about "atan"</strong></small> </a> <ul> <li><small> <a href="s_105.html#s03_04_01_06">3.4.1.6 Julia Fractal</a> in 3.4.1 Finite Solid Primitives </small> <li><small> <a href="s_97.html#s03_02_01_03_04">3.2.1.3.4 Functions</a> in 3.2.1.3 Float Expressions </small> </ul> </p> <p> <a name="l65"> <small><strong>More about "atan2"</strong></small> </a> <ul> <li><small> <a href="s_140.html#s03_07_09_01">3.7.9.1 Float functions and macros</a> in 3.7.9 math.inc </small> <li><small> <a href="s_97.html#s03_02_01_03_04">3.2.1.3.4 Functions</a> in 3.2.1.3 Float Expressions </small> </ul> </p> <p> <a name="l66"> <small><strong>More about "autostop"</strong></small> </a> <ul> <li><small> <a href="s_130.html#s03_06_03_02_01">3.6.3.2.1 Photon Global Settings</a> in 3.6.3.2 Using Photon Mapping in Your Scene </small> <li><small> <a href="s_130.html#s03_06_03_05_01">3.6.3.5.1 Autostop</a> in 3.6.3.5 Advanced Techniques </small> </ul> </p> <p> <a name="l67"> <small><strong>More about "background"</strong></small> </a> <ul> <li><small> <a href="s_101.html#s03_03_02_02">3.3.2.2 Background</a> in 3.3.2 Atmospheric Effects </small> <li><small> <a href="s_164.html#s03_08_12_01">3.8.12.1 Background</a> in 3.8.12 Atmospheric Effects </small> </ul> </p> <p> <a name="l68"> <small><strong>More about "camera"</strong></small> </a> <ul> <li><small> <a href="s_100.html#s03_03_01">3.3.1 Camera</a> in 3.3 Scene Settings </small> <li><small> <a href="s_158.html#s03_08_06">3.8.6 Camera</a> in 3.8 Quick Reference </small> </ul> </p> <p> <a name="l69"> <small><strong>More about "color"</strong></small> </a> <ul> <li><small> <a href="s_155.html#s03_08_03_03">3.8.3.3 Colors</a> in 3.8.3 Language Basics </small> <li><small> <a href="s_97.html#s03_02_01_05">3.2.1.5 Specifying Colors</a> in 3.2.1 Language Basics </small> </ul> </p> <p> <a name="l70"> <small><strong>More about "cos"</strong></small> </a> <ul> <li><small> <a href="s_140.html#s03_07_09_01">3.7.9.1 Float functions and macros</a> in 3.7.9 math.inc </small> <li><small> <a href="s_97.html#s03_02_01_03_04">3.2.1.3.4 Functions</a> in 3.2.1.3 Float Expressions </small> </ul> </p> <p> <a name="l71"> <small><strong>More about "error_bound"</strong></small> </a> <ul> <li><small> <a href="s_103.html#s03_03_04_02_05">3.3.4.2.5 error_bound</a> in 3.3.4.2 Adjusting Radiosity </small> <li><small> <a href="s_103.html#s03_03_04_02_11">3.3.4.2.11 nearest_count</a> in 3.3.4.2 Adjusting Radiosity </small> </ul> </p> <p> <a name="l72"> <small><strong>More about "finish"</strong></small> </a> <ul> <li><small> <a href="s_117.html#s03_05_03">3.5.3 Finish</a> in 3.5 Textures </small> <li><small> <a href="s_162.html#s03_08_10_06">3.8.10.6 Finish</a> in 3.8.10 Texture </small> </ul> </p> <p> <a name="l73"> <small><strong>More about "fog"</strong></small> </a> <ul> <li><small> <a href="s_101.html#s03_03_02_03">3.3.2.3 Fog</a> in 3.3.2 Atmospheric Effects </small> <li><small> <a href="s_164.html#s03_08_12_02">3.8.12.2 Fog</a> in 3.8.12 Atmospheric Effects </small> </ul> </p> <p> <a name="l74"> <small><strong>More about "function"</strong></small> </a> <ul> <li><small> <a href="s_97.html#s03_02_01_03_04">3.2.1.3.4 Functions</a> in 3.2.1.3 Float Expressions </small> <li><small> <a href="s_97.html#s03_02_01_04_05">3.2.1.4.5 Functions</a> in 3.2.1.4 Vector Expressions </small> <li><small> <a href="s_97.html#s03_02_01_06">3.2.1.6 User-Defined Functions</a> in 3.2.1 Language Basics </small> </ul> </p> <p> <a name="l75"> <small><strong>More about "global_settings"</strong></small> </a> <ul> <li><small> <a href="s_102.html#s03_03_03">3.3.3 Global Settings</a> in 3.3 Scene Settings </small> <li><small> <a href="s_165.html#s03_08_13">3.8.13 Global Settings</a> in 3.8 Quick Reference </small> <li><small> <a href="s_75.html#s02_03_10_04">2.3.10.4 Global settings</a> in 2.3.10 SDL tutorial: A raytracer </small> </ul> </p> <p> <a name="l76"> <small><strong>More about "gradient"</strong></small> </a> <ul> <li><small> <a href="s_125.html#s03_05_11_17">3.5.11.17 Gradient</a> in 3.5.11 Patterns </small> <li><small> <a href="s_140.html#s03_07_09_03">3.7.9.3 Vector Analysis</a> in 3.7.9 math.inc </small> </ul> </p> <p> <a name="l77"> <small><strong>More about "interior"</strong></small> </a> <ul> <li><small> <a href="s_128.html#s03_06_01">3.6.1 Interior</a> in 3.6 Interior & Media & Photons </small> <li><small> <a href="s_161.html#s03_08_09_03">3.8.9.3 Interior</a> in 3.8.9 Object Modifiers </small> </ul> </p> <p> <a name="l78"> <small><strong>More about "interior_texture"</strong></small> </a> <ul> <li><small> <a href="s_123.html#s03_05_09">3.5.9 Interior Texture</a> in 3.5 Textures </small> <li><small> <a href="s_161.html#s03_08_09_04">3.8.9.4 Interior Texture</a> in 3.8.9 Object Modifiers </small> </ul> </p> <p> <a name="l79"> <small><strong>More about "ior"</strong></small> </a> <ul> <li><small> <a href="s_128.html#s03_06_01_04">3.6.1.4 Refraction</a> in 3.6.1 Interior </small> <li><small> <a href="s_135.html#s03_07_04_06">3.7.4.6 IORs</a> in 3.7.4 consts.inc </small> </ul> </p> <p> <a name="l80"> <small><strong>More about "isosurface"</strong></small> </a> <ul> <li><small> <a href="s_108.html#s03_04_04">3.4.4 Isosurface Object</a> in 3.4 Objects </small> <li><small> <a href="s_160.html#s03_08_08_04">3.8.8.4 Isosurface</a> in 3.8.8 Objects </small> </ul> </p> <p> <a name="l81"> <small><strong>More about "macro"</strong></small> </a> <ul> <li><small> <a href="s_156.html#s03_08_04_08">3.8.4.8 Macro</a> in 3.8.4 Language Directives </small> <li><small> <a href="s_98.html#s03_02_02_08">3.2.2.8 User Defined Macros</a> in 3.2.2 Language Directives </small> </ul> </p> <p> <a name="l82"> <small><strong>More about "material"</strong></small> </a> <ul> <li><small> <a href="s_113.html#s03_04_09_03">3.4.9.3 Material</a> in 3.4.9 Object Modifiers </small> <li><small> <a href="s_161.html#s03_08_09_02">3.8.9.2 Material</a> in 3.8.9 Object Modifiers </small> </ul> </p> <p> <a name="l83"> <small><strong>More about "matrix"</strong></small> </a> <ul> <li><small> <a href="s_157.html#s03_08_05">3.8.5 Transformations</a> in 3.8 Quick Reference </small> <li><small> <a href="s_63.html#s02_02_07_01_04">2.2.7.1.4 Matrix</a> in 2.2.7.1 Transformations </small> </ul> </p> <p> <a name="l84"> <small><strong>More about "max"</strong></small> </a> <ul> <li><small> <a href="s_140.html#s03_07_09_01">3.7.9.1 Float functions and macros</a> in 3.7.9 math.inc </small> <li><small> <a href="s_97.html#s03_02_01_03_04">3.2.1.3.4 Functions</a> in 3.2.1.3 Float Expressions </small> </ul> </p> <p> <a name="l85"> <small><strong>More about "media"</strong></small> </a> <ul> <li><small> <a href="s_129.html#s03_06_02">3.6.2 Media</a> in 3.6 Interior & Media & Photons </small> <li><small> <a href="s_163.html#s03_08_11">3.8.11 Media</a> in 3.8 Quick Reference </small> </ul> </p> <p> <a name="l86"> <small><strong>More about "mesh"</strong></small> </a> <ul> <li><small> <a href="s_106.html#s03_04_02_03">3.4.2.3 Mesh</a> in 3.4.2 Finite Patch Primitives </small> <li><small> <a href="s_106.html#s03_04_02_04">3.4.2.4 Mesh2</a> in 3.4.2 Finite Patch Primitives </small> </ul> </p> <p> <a name="l87"> <small><strong>More about "min"</strong></small> </a> <ul> <li><small> <a href="s_140.html#s03_07_09_01">3.7.9.1 Float functions and macros</a> in 3.7.9 math.inc </small> <li><small> <a href="s_140.html#s03_07_09_02">3.7.9.2 Vector functions and macros</a> in 3.7.9 math.inc </small> <li><small> <a href="s_97.html#s03_02_01_03_04">3.2.1.3.4 Functions</a> in 3.2.1.3 Float Expressions </small> </ul> </p> <p> <a name="l88"> <small><strong>More about "noise_generator"</strong></small> </a> <ul> <li><small> <a href="s_102.html#s03_03_03_10">3.3.3.10 Noise_generator</a> in 3.3.3 Global Settings </small> <li><small> <a href="s_126.html#s03_05_12">3.5.12 Pattern Modifiers</a> in 3.5 Textures </small> <li><small> <a href="s_126.html#s03_05_12_04">3.5.12.4 Noise Generators</a> in 3.5.12 Pattern Modifiers </small> </ul> </p> <p> <a name="l89"> <small><strong>More about "normal"</strong></small> </a> <ul> <li><small> <a href="s_116.html#s03_05_02">3.5.2 Normal</a> in 3.5 Textures </small> <li><small> <a href="s_162.html#s03_08_10_05">3.8.10.5 Normal</a> in 3.8.10 Texture </small> <li><small> <a href="s_69.html#s02_03_04_02">2.3.4.2 Normals</a> in 2.3.4 Advanced Texture Options </small> </ul> </p> <p> <a name="l90"> <small><strong>More about "object"</strong></small> </a> <ul> <li><small> <a href="s_104.html#s03_04">3.4 Objects</a> in 3 POV-Ray Reference </small> <li><small> <a href="s_125.html#s03_05_11_23">3.5.11.23 Object Pattern</a> in 3.5.11 Patterns </small> <li><small> <a href="s_160.html#s03_08_08">3.8.8 Objects</a> in 3.8 Quick Reference </small> </ul> </p> <p> <a name="l91"> <small><strong>More about "open"</strong></small> </a> <ul> <li><small> <a href="s_128.html#s03_06_01">3.6.1 Interior</a> in 3.6 Interior & Media & Photons </small> <li><small> <a href="s_98.html#s03_02_02_03_01">3.2.2.3.1 The #fopen Directive</a> in 3.2.2.3 File I/O Directives </small> </ul> </p> <p> <a name="l92"> <small><strong>More about "parametric"</strong></small> </a> <ul> <li><small> <a href="s_109.html#s03_04_05">3.4.5 Parametric Object</a> in 3.4 Objects </small> <li><small> <a href="s_160.html#s03_08_08_05">3.8.8.5 Parametric</a> in 3.8.8 Objects </small> </ul> </p> <p> <a name="l93"> <small><strong>More about "pattern"</strong></small> </a> <ul> <li><small> <a href="s_125.html#s03_05_11">3.5.11 Patterns</a> in 3.5 Textures </small> <li><small> <a href="s_162.html#s03_08_10_07">3.8.10.7 Pattern</a> in 3.8.10 Texture </small> <li><small> <a href="s_97.html#s03_02_01_06_03">3.2.1.6.3 Declaring User-Defined Float Functions</a> in 3.2.1.6 User-Defined Functions </small> </ul> </p> <p> <a name="l94"> <small><strong>More about "photons"</strong></small> </a> <ul> <li><small> <a href="s_130.html#s03_06_03">3.6.3 Photons</a> in 3.6 Interior & Media & Photons </small> <li><small> <a href="s_130.html#s03_06_03_02_01">3.6.3.2.1 Photon Global Settings</a> in 3.6.3.2 Using Photon Mapping in Your Scene </small> <li><small> <a href="s_165.html#s03_08_13_02">3.8.13.2 Photons</a> in 3.8.13 Global Settings </small> </ul> </p> <p> <a name="l95"> <small><strong>More about "pigment"</strong></small> </a> <ul> <li><small> <a href="s_115.html#s03_05_01">3.5.1 Pigment</a> in 3.5 Textures </small> <li><small> <a href="s_162.html#s03_08_10_04">3.8.10.4 Pigment</a> in 3.8.10 Texture </small> <li><small> <a href="s_69.html#s02_03_04_01">2.3.4.1 Pigments</a> in 2.3.4 Advanced Texture Options </small> </ul> </p> <p> <a name="l96"> <small><strong>More about "pow"</strong></small> </a> <ul> <li><small> <a href="s_140.html#s03_07_09_02">3.7.9.2 Vector functions and macros</a> in 3.7.9 math.inc </small> <li><small> <a href="s_97.html#s03_02_01_03_04">3.2.1.3.4 Functions</a> in 3.2.1.3 Float Expressions </small> </ul> </p> <p> <a name="l97"> <small><strong>More about "radiosity"</strong></small> </a> <ul> <li><small> <a href="s_103.html#s03_03_04">3.3.4 Radiosity</a> in 3.3 Scene Settings </small> <li><small> <a href="s_165.html#s03_08_13_01">3.8.13.1 Radiosity</a> in 3.8.13 Global Settings </small> <li><small> <a href="s_72.html#s02_03_07">2.3.7 Radiosity</a> in 2.3 Advanced Features </small> </ul> </p> <p> <a name="l98"> <small><strong>More about "rainbow"</strong></small> </a> <ul> <li><small> <a href="s_101.html#s03_03_02_05">3.3.2.5 Rainbow</a> in 3.3.2 Atmospheric Effects </small> <li><small> <a href="s_164.html#s03_08_12_04">3.8.12.4 Rainbow</a> in 3.8.12 Atmospheric Effects </small> </ul> </p> <p> <a name="l99"> <small><strong>More about "rand"</strong></small> </a> <ul> <li><small> <a href="s_117.html#s03_05_03_02_03">3.5.3.2.3 Crand Graininess</a> in 3.5.3.2 Diffuse Reflection Items </small> <li><small> <a href="s_142.html#s03_07_11_01">3.7.11.1 Flat Distributions</a> in 3.7.11 rand.inc </small> <li><small> <a href="s_97.html#s03_02_01_03_04">3.2.1.3.4 Functions</a> in 3.2.1.3 Float Expressions </small> </ul> </p> <p> <a name="l100"> <small><strong>More about "refraction"</strong></small> </a> <ul> <li><small> <a href="s_128.html#s03_06_01_04">3.6.1.4 Refraction</a> in 3.6.1 Interior </small> <li><small> <a href="s_130.html#s03_06_03_02_01">3.6.3.2.1 Photon Global Settings</a> in 3.6.3.2 Using Photon Mapping in Your Scene </small> </ul> </p> <p> <a name="l101"> <small><strong>More about "rotate"</strong></small> </a> <ul> <li><small> <a href="s_157.html#s03_08_05">3.8.5 Transformations</a> in 3.8 Quick Reference </small> <li><small> <a href="s_63.html#s02_02_07_01_03">2.2.7.1.3 Rotate</a> in 2.2.7.1 Transformations </small> <li><small> <a href="s_97.html#s03_02_01_04_05">3.2.1.4.5 Functions</a> in 3.2.1.4 Vector Expressions </small> </ul> </p> <p> <a name="l102"> <small><strong>More about "scale"</strong></small> </a> <ul> <li><small> <a href="s_157.html#s03_08_05">3.8.5 Transformations</a> in 3.8 Quick Reference </small> <li><small> <a href="s_63.html#s02_02_07_01_02">2.2.7.1.2 Scale</a> in 2.2.7.1 Transformations </small> </ul> </p> <p> <a name="l103"> <small><strong>More about "sin"</strong></small> </a> <ul> <li><small> <a href="s_140.html#s03_07_09_01">3.7.9.1 Float functions and macros</a> in 3.7.9 math.inc </small> <li><small> <a href="s_97.html#s03_02_01_03_04">3.2.1.3.4 Functions</a> in 3.2.1.3 Float Expressions </small> </ul> </p> <p> <a name="l104"> <small><strong>More about "sky_sphere"</strong></small> </a> <ul> <li><small> <a href="s_101.html#s03_03_02_04">3.3.2.4 Sky Sphere</a> in 3.3.2 Atmospheric Effects </small> <li><small> <a href="s_164.html#s03_08_12_03">3.8.12.3 Sky Sphere</a> in 3.8.12 Atmospheric Effects </small> </ul> </p> <p> <a name="l105"> <small><strong>More about "spline"</strong></small> </a> <ul> <li><small> <a href="s_155.html#s03_08_03_07">3.8.3.7 Splines</a> in 3.8.3 Language Basics </small> <li><small> <a href="s_97.html#s03_02_01_09">3.2.1.9 Spline Identifiers</a> in 3.2.1 Language Basics </small> </ul> </p> <p> <a name="l106"> <small><strong>More about "sqr"</strong></small> </a> <ul> <li><small> <a href="s_105.html#s03_04_01_06">3.4.1.6 Julia Fractal</a> in 3.4.1 Finite Solid Primitives </small> <li><small> <a href="s_140.html#s03_07_09_02">3.7.9.2 Vector functions and macros</a> in 3.7.9 math.inc </small> <li><small> <a href="s_97.html#s03_02_01_03_04">3.2.1.3.4 Functions</a> in 3.2.1.3 Float Expressions </small> </ul> </p> <p> <a name="l107"> <small><strong>More about "tan"</strong></small> </a> <ul> <li><small> <a href="s_105.html#s03_04_01_06">3.4.1.6 Julia Fractal</a> in 3.4.1 Finite Solid Primitives </small> <li><small> <a href="s_140.html#s03_07_09_01">3.7.9.1 Float functions and macros</a> in 3.7.9 math.inc </small> <li><small> <a href="s_97.html#s03_02_01_03_04">3.2.1.3.4 Functions</a> in 3.2.1.3 Float Expressions </small> </ul> </p> <p> <a name="l108"> <small><strong>More about "texture"</strong></small> </a> <ul> <li><small> <a href="s_114.html#s03_05">3.5 Textures</a> in 3 POV-Ray Reference </small> <li><small> <a href="s_162.html#s03_08_10">3.8.10 Texture</a> in 3.8 Quick Reference </small> </ul> </p> <p> <a name="l109"> <small><strong>More about "texture_list"</strong></small> </a> <ul> <li><small> <a href="s_106.html#s03_04_02_04">3.4.2.4 Mesh2</a> in 3.4.2 Finite Patch Primitives </small> <li><small> <a href="s_122.html#s03_05_08">3.5.8 Triangle Texture Interpolation</a> in 3.5 Textures </small> </ul> </p> <p> <a name="l110"> <small><strong>More about "transform"</strong></small> </a> <ul> <li><small> <a href="s_149.html#s03_07_18">3.7.18 transforms.inc</a> in 3.7 Include Files </small> <li><small> <a href="s_157.html#s03_08_05">3.8.5 Transformations</a> in 3.8 Quick Reference </small> </ul> </p> <p> <a name="l111"> <small><strong>More about "translate"</strong></small> </a> <ul> <li><small> <a href="s_157.html#s03_08_05">3.8.5 Transformations</a> in 3.8 Quick Reference </small> <li><small> <a href="s_63.html#s02_02_07_01_01">2.2.7.1.1 Translate</a> in 2.2.7.1 Transformations </small> </ul> </p> <p> <a name="l112"> <small><strong>More about "turbulence"</strong></small> </a> <ul> <li><small> <a href="s_126.html#s03_05_12">3.5.12 Pattern Modifiers</a> in 3.5 Textures </small> <li><small> <a href="s_126.html#s03_05_12_05">3.5.12.5 Turbulence</a> in 3.5.12 Pattern Modifiers </small> <li><small> <a href="s_97.html#s03_02_01_04_05">3.2.1.4.5 Functions</a> in 3.2.1.4 Vector Expressions </small> </ul> </p> <p> <a name="l113"> <small><strong>More about "uv_mapping"</strong></small> </a> <ul> <li><small> <a href="s_121.html#s03_05_07">3.5.7 UV Mapping</a> in 3.5 Textures </small> <li><small> <a href="s_161.html#s03_08_09_01">3.8.9.1 UV Mapping</a> in 3.8.9 Object Modifiers </small> </ul> </p> <p> <a name="l114"> <small><strong>More about "uv_vectors"</strong></small> </a> <ul> <li><small> <a href="s_106.html#s03_04_02_04">3.4.2.4 Mesh2</a> in 3.4.2 Finite Patch Primitives </small> <li><small> <a href="s_121.html#s03_05_07_02">3.5.7.2 UV Vectors</a> in 3.5.7 UV Mapping </small> </ul> </p> <p> <a name="l115"> <small><strong>More about "warp"</strong></small> </a> <ul> <li><small> <a href="s_126.html#s03_05_12">3.5.12 Pattern Modifiers</a> in 3.5 Textures </small> <li><small> <a href="s_126.html#s03_05_12_06">3.5.12.6 Warps</a> in 3.5.12 Pattern Modifiers </small> </ul> </p> <p> <a name="l116"> <small><strong>More about "wood"</strong></small> </a> <ul> <li><small> <a href="s_125.html#s03_05_11_36">3.5.11.36 Wood</a> in 3.5.11 Patterns </small> <li><small> <a href="s_148.html#s03_07_17_03">3.7.17.3 Woods</a> in 3.7.17 textures.inc </small> </ul> </p> <p> <a name="l117"> <small><strong>More about "Strings"</strong></small> </a> <ul> <li><small> <a href="s_155.html#s03_08_03_05">3.8.3.5 Strings</a> in 3.8.3 Language Basics </small> <li><small> <a href="s_97.html#s03_02_01_07">3.2.1.7 Strings</a> in 3.2.1 Language Basics </small> </ul> </p> <p> <a name="l118"> <small><strong>More about "macros"</strong></small> </a> <ul> <li><small> <a href="s_156.html#s03_08_04_08">3.8.4.8 Macro</a> in 3.8.4 Language Directives </small> <li><small> <a href="s_98.html#s03_02_02_08">3.2.2.8 User Defined Macros</a> in 3.2.2 Language Directives </small> </ul> </p> <p> <a name="l119"> <small><strong>More about "#macro"</strong></small> </a> <ul> <li><small> <a href="s_156.html#s03_08_04_08">3.8.4.8 Macro</a> in 3.8.4 Language Directives </small> <li><small> <a href="s_98.html#s03_02_02_08">3.2.2.8 User Defined Macros</a> in 3.2.2 Language Directives </small> </ul> </p> <br> <table class="NavBar" width="100%"> <tr> <td align="left" nowrap="" valign="middle" width="32"> <a href="s_96.html"><img alt="previous" border="0" src="prev.png"></a> </td> <td align="left" valign="middle" width="30%"> <a href="s_96.html">3.2 Scene Description Language</a> </td> <td align="center" valign="middle"> <strong>3.2.1 Language Basics</strong> </td> <td align="right" valign="middle" width="30%"> <a href="s_98.html">3.2.2 Language Directives</a> </td> <td align="right" nowrap="" valign="middle" width="32"> <a href="s_98.html"><img alt="next" border="0" src="next.png"></a> </td> </tr> </table> </body> </html>