home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inside Multimedia 1995 December
/
IMM1295.ISO
/
share
/
grafik
/
povhelp
/
float.hlp
< prev
next >
Wrap
Text File
|
1994-07-04
|
2KB
|
36 lines
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. Float literals are represented by an optional sign (-), some 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:
1.0 -2.0 -4 34 3.4e6 2e-5 .3 0.6
Float identifiers may be declared and used anywhere a float can be used.
Complex float expressions can be created using + - * / ( ) with float li-
terals or identifiers. Assuming the identifiers have been previously decla-
red as floats, the following are valid float expressions:
1+2+3 2*5 1/3 Row*3 Col*5
(Offset-5)/2 This/That+Other*Thing
Expressions are evaluated left to right with innermost parenthesis evalu-
ated first, then unary + / -, then multiply / divide, then add or subtract.
There are two built-in float identifiers. The identifier "version" is
the current setting of the version compatibility switch. This allows you to
save and restore the previous version switch. For example: suppose MYSTUFF
.INC is in version 1.0 format. At the top of the file you could put:
#declare 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
The other float identifier is "clock". Its value is set by the +K com-
mand-line switch. (See +K under command-line switches). This allows you to
do limited animation control. For example you could move an object using:
translate <0.1*clock, 0, 0>
and render successive frames with +K1, +K2, +K3 etc. In each frame the ob-
ject would move 1/10th of a unit.