When using filter transparency, the colors which come through are multiplied by the primary color components. For example if grey light such as rgb <0.9,0.9,0.9> passes through a filter such as rgbf <1.0,0.5,0.0,1.0> the result is rgb <0.9,0.45,0.0> 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
but this has implied red, green and blue values of zero. You've just specified a totally black filter so no light passes through. The correct way is either
or
In the 2nd example it doesn't 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...
this substitutes whatever was the red component of My_Color with a red component of 0.5 however...
adds 0.5 to the red component of My_Color and even less obvious...
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 rgbft <0.5,0,0,0,0> as a full 5 component color.
The following example results in no change to My_Color .
This is because the identifier fully overwrites the previous value. When using identifiers with color keywords, the identifier should be first.
One final issue, 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:
The ambient keyword expects a color so the value 1 is promoted to <1,1,1,1,1> which is no problem. However
is legal but it may or may not be what you intended. The 0.4 is promoted to <0.4,0.4,0.4,0.4,0.> with the filter and transmit set to 0.4 as well. It is more likely you wanted...
in which case a 3 component vector is expected. Therefore the 0.4 is promoted to <0.4,0.4,0.4,0.0,0.0> with default zero for filter and transmit.
"Here" "There" "myfile.gif" "textures.inc"
Where IDENTIFIER is the name of the identifier up to 40 characters long and STRING is a string literal, string identifier or function which returns a string value. Here are some examples...
As the last example shows, you can re-declare a string identifier and may use previously declared values in that re-declaration.
The built-in float identifier pi is obviously useful in math expressions involving circles.
The built-in float identifiers on , off , yes , no , true and false are designed for use as boolean constants.
The built-in vector identifiers x , y and z provide much greater readability for your scene files when used in vector expressions. For example....
An expression like 5*x evaluates to 5 <1,0,0> or <5,0,0>.
Similarly u and v may be used in 2D vectors. When using 4D vectors you should use x , y , z , and t and POV-Ray will promote x , y and z to 4D when used where 4D is required.
Other INI options and switches may be used to animate scenes by automatically looping through the rendering of frames using various values for clock . 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. For example if your object is supposed to rotate one full turn over the course of the animation you could specify rotate 360*clock*y . Then as clock runs from 0 to 1, the object rotates about the y-axis from 0 to 360 degrees.
Although the value of clock will change from frame-to-frame, it will never change throughout the parsing of a scene.
See "Animation Options" for more details.
The INI option or switch only affects the initial setting. Unlike other built-in identifiers, you may change the value of version throughout a scene file. You do not use #declare to change it though. The #version language directive is used to change modes. Such changes may occur several times within scene files.
Together with the built-in version identifier the #version directive allows you to save and restore the previous values of this compatibility setting. For example suppose mystuff.inc is in version 1 format. At the top of the file you could put:
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:
Functions evaluate to values that are floats, vectors or strings and may be used in expressions or statements anywhere that literals or identifiers of that type may be used.
Section 7.1.7.2
Built-in Identifier 'clock'
Section 7.1.7.3
Built-in Identifier 'version'
Section 7.1.8
Functions
Table Of Contents