POV-Ray: Language directives

  1. #include
    loads .inc files that describe any data used in .pov files as:
    #include “file.inc”
  2. #declare and #local
    declares identifiers. Identifiers include vector, object, *_map, etc. For scalar, vector, and color, don’t forget put ; at the end:
    #declare PosCenter = <1, 2, 3>;
    #declare MyTorus = torus {5,1}
    #declare MyCheck = pigment{ …}
    identifiers
  3. #fopen, #fclose, #read, #write
    used forfile I/O as:
    #fopen fp “filename” read
    #read( fp, var1, var2, … )
    #fclose fp

    #fopen fp “filename” write
    #write( fp, “test “, var1, ” “, var2, … )
    #fclose fp

  4. #macro
    defines macros like function as:
    #macro MyMacro (var1, …)
    // do some processes
    #end
  5. #default
    sets default texture that is texture used when no texture is used.
  6. #switch, #case, #range
    used for branching as
    #switch (VALUE)

      #case (CASE_1)
        // do …
        #break
      #range (LOW_1, HIGH_1)
        // do …
        #break
      #case (CASE_2)
        // do …
        #break
      #range (LOW_2, HIGH_2)
        // do …
        #break
      #else
        // do …
    #end // end for switch
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s