Difference between revisions of "Reference Talk:User Defined Pattern"

From POV-Wiki
Jump to navigation Jump to search
(Created page with " copied from the povray.beta-test newsgroup: ---- This version adds a new pigment pattern: pigment { user_defined { function { RED_FUNCTION }, funct...")
 
m (completed mark up)
 
Line 1: Line 1:
 +
<p>{{New}} in version 3.7.1 a special pigment pattern <code>user_defined</code> has been added to define the pigment color directly in terms of a set of functions.</p>
  
copied from the povray.beta-test newsgroup:
+
<p>The syntax is a follows:</p>
----
 
This version adds a new pigment pattern:
 
  
    pigment {
+
<pre>
      user_defined {
+
pigment {
        function { RED_FUNCTION },
+
  user_defined {
        function { GREEN_FUNCTION },
+
    function { RED_FUNCTION },
        function { BLUE_FUNCTION },
+
    function { GREEN_FUNCTION },
        function { FILTER_FUNCTION },
+
    function { BLUE_FUNCTION },
        function { TRANSMIT_FUNCTION }
+
    function { FILTER_FUNCTION },
      }
+
    function { TRANSMIT_FUNCTION }
 
     }
 
     }
 +
  }
 +
</pre>
  
Each function is optional, in which case the corresponding component is
+
<p>Each function is <em>optional</em>, in which case the corresponding component is set to 0. For example, the following sets the color to <code>rgbft &lt;x,y,0,0,z&gt;</code>:</p>
set to 0. For example, the following sets the colour to rgbft <x,y,0,0,z>:
 
  
    pigment {
+
<pre>
      user_defined {
+
pigment {
        function { x },
+
  user_defined {
        function { y },
+
    function { x },
        ,,
+
    function { y },
        function { z }
+
    ,,
      }
+
    function { z }
 
     }
 
     }
----
+
  }
 +
</pre>
  
The pattern is similar to `image_map` in that it directly specifies colours, rather than using a `colour_map` or `pigment_map`.
+
<p>The pattern is similar to <code>image_map</code> in that it directly specifies <em>colors</em> rather than using a <code>[[Reference:Color Map|Color Map]]</code> or <code>[[Reference:Pigment Map|Pigment Map]]</code>.

Latest revision as of 11:57, 20 December 2016

New in version 3.7.1 a special pigment pattern user_defined has been added to define the pigment color directly in terms of a set of functions.

The syntax is a follows:

pigment {
  user_defined {
    function { RED_FUNCTION },
    function { GREEN_FUNCTION },
    function { BLUE_FUNCTION },
    function { FILTER_FUNCTION },
    function { TRANSMIT_FUNCTION }
    }
  }

Each function is optional, in which case the corresponding component is set to 0. For example, the following sets the color to rgbft <x,y,0,0,z>:

pigment {
  user_defined {
    function { x },
    function { y },
    ,,
    function { z }
    }
  }

The pattern is similar to image_map in that it directly specifies colors rather than using a Color Map or Pigment Map.