## 3.2 Scene Description Language

The reference section describes the POV-Ray scene description language. It is supposed to be used as a reference for looking up things. It does not contain detailed explanations on how scenes are written or how POV-Ray is used. It just explains all features, their syntax, applications, limits, drawbacks, etc.

The scene description language allows you to describe the world in a readable and convenient way. Files are created in plain ASCII text using an editor of your choice. The input file name is specified using the `Input_File_Name`=file option or `+I` file switch. By default the files have the extension `.pov`. POV-Ray reads the file, processes it by creating an internal model of the scene and then renders the scene.

The overall syntax of a scene is shown below. See "Notation and Basic Assumptions" for more information on syntax notation.

    SCENE:
        SCENE_ITEM...
    SCENE_ITEM:
        LANGUAGE_DIRECTIVES        |
        camera { CAMERA_ITEMS... } |
        OBJECTS                    |
        ATMOSPHERIC_EFFECTS        |
        global_settings { GLOBAL_ITEMS }

In plain English, this means that a scene contains one or more scene items and that a scene item may be any of the five items listed below it. The items may appear in any order. None is a required item. In addition to the syntax depicted above, a LANGUAGE_DIRECTIVE may also appear anywhere embedded in other statements between any two tokens. There are some restrictions on nesting directives also.

For details on those five items see section "Language Directives", section "Objects", section "Camera", section "Atmospheric Effects" and section "Global Settings" for details.

Section Contents

- 3.2.1 Language Basics
  - 3.2.1.1 Identifiers and Keywords
  - 3.2.1.2 Comments
  - 3.2.1.3 Float Expressions
    - 3.2.1.3.1 Literals
    - 3.2.1.3.2 Identifiers
    - 3.2.1.3.3 Operators
    - 3.2.1.3.4 Functions
    - 3.2.1.3.5 Built-in Constants
    - 3.2.1.3.6 Built-in Variables
  - 3.2.1.4 Vector Expressions
    - 3.2.1.4.1 Literals
    - 3.2.1.4.2 Identifiers
    - 3.2.1.4.3 Operators
    - 3.2.1.4.4 Operator Promotion
    - 3.2.1.4.5 Functions
    - 3.2.1.4.6 Built-in Constants
  - 3.2.1.5 Specifying Colors
    - 3.2.1.5.1 Color Vectors
    - 3.2.1.5.2 Color Keywords
    - 3.2.1.5.3 Color Identifiers
    - 3.2.1.5.4 Color Operators
    - 3.2.1.5.5 Common Color Pitfalls
  - 3.2.1.6 User-Defined Functions
    - 3.2.1.6.1 Sum and Product functions
    - 3.2.1.6.2 Functions and Macros
    - 3.2.1.6.3 Declaring User-Defined Float Functions
    - 3.2.1.6.4 Declaring User-Defined Vector Functions
    - 3.2.1.6.5 Declaring User-Defined Color Functions
    - 3.2.1.6.6 Internal Pre-Defined Functions
  - 3.2.1.7 Strings
    - 3.2.1.7.1 String Literals
    - 3.2.1.7.2 String Identifiers
    - 3.2.1.7.3 String Functions
  - 3.2.1.8 Array Identifiers
    - 3.2.1.8.1 Declaring Arrays
    - 3.2.1.8.2 Array Initializers
  - 3.2.1.9 Spline Identifiers
    - 3.2.1.9.1 Splines and Macros
- 3.2.2 Language Directives
  - 3.2.2.1 Include Files and the #include Directive
  - 3.2.2.2 The #declare and #local Directives
    - 3.2.2.2.1 Declaring identifiers
    - 3.2.2.2.2 #declare vs. #local
    - 3.2.2.2.3 Identifier Name Collisions
    - 3.2.2.2.4 Destroying Identifiers with #undef
  - 3.2.2.3 File I/O Directives
    - 3.2.2.3.1 The #fopen Directive
    - 3.2.2.3.2 The #fclose Directive
    - 3.2.2.3.3 The #read Directive
    - 3.2.2.3.4 The #write Directive
  - 3.2.2.4 The #default Directive
  - 3.2.2.5 The #version Directive
  - 3.2.2.6 Conditional Directives
    - 3.2.2.6.1 The #if...#else...#end Directives
    - 3.2.2.6.2 The #ifdef and #ifndef Directives
    - 3.2.2.6.3 The #switch, #case, #range and #break Directives
    - 3.2.2.6.4 The #while...#end Directive
  - 3.2.2.7 User Message Directives
    - 3.2.2.7.1 Text Message Streams
    - 3.2.2.7.2 Text Formatting
  - 3.2.2.8 User Defined Macros
    - 3.2.2.8.1 The #macro Directive
    - 3.2.2.8.2 Invoking Macros
    - 3.2.2.8.3 Are POV-Ray Macros a Function or a Macro?
    - 3.2.2.8.4 Returning a Value Like a Function
    - 3.2.2.8.5 Returning Values Via Parameters

More about "Notation and Basic Assumptions"

- 2.1.7 Notation and Basic Assumptions in 2.1 Introduction
- 3.1.1 Notation and Basic Assumptions in 3.1 Introduction

More about "Language Directives"

- 3.8.4 Language Directives in 3.8 Quick Reference
- 3.2.2 Language Directives in 3.2 Scene Description Language

More about "Object"

- 3.4 Objects in 3 POV-Ray Reference
- 3.5.11.23 Object Pattern in 3.5.11 Patterns
- 3.8.8 Objects in 3.8 Quick Reference

More about "Camera"

- 3.3.1 Camera in 3.3 Scene Settings
- 3.8.6 Camera in 3.8 Quick Reference

More about "Atmospheric Effects"

- 3.3.2 Atmospheric Effects in 3.3 Scene Settings
- 3.8.12 Atmospheric Effects in 3.8 Quick Reference

More about "Global Settings"

- 3.3.3 Global Settings in 3.3 Scene Settings
- 3.8.13 Global Settings in 3.8 Quick Reference
- 2.3.10.4 Global settings in 2.3.10 SDL tutorial: A raytracer