Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
POV-Ray
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Examples of the scene description language=== The following is an example of the scene description language used by POV-Ray to describe a scene to render. It demonstrates the use of a background colour, camera, lights, a simple box shape having a surface normal and finish, and the transforming effects of rotation. [[Image:I example povray scene rendering.png|thumb|right|POV-Ray image output based on the script]] <syntaxhighlight lang="pov"> #version 3.6; // Includes a separate file defining a number of common colours #include "colors.inc" global_settings { assumed_gamma 1.0 } // Sets a background colour for the image (dark grey) background { color rgb <0.25, 0.25, 0.25> } // Places a camera // direction: Sets, among other things, the field of view of the camera // right: Sets the aspect ratio of the image // look_at: Tells the camera where to look camera { location <0.0, 0.5, -4.0> direction 1.5*z right x*image_width/image_height look_at <0.0, 0.0, 0.0> } // Places a light source // color: Sets the color of the light source (white) // translate: Moves the light source to a desired location light_source { <0, 0, 0> color rgb <1, 1, 1> translate <-5, 5, -5> } // Places another light source // color: Sets the color of the light source (dark grey) // translate: Moves the light source to a desired location light_source { <0, 0, 0> color rgb <0.25, 0.25, 0.25> translate <6, -6, -6> } // Sets a box // pigment: Sets a color for the box ("Red" as defined in "colors.inc") // finish: Sets how the surface of the box reflects light // normal: Sets a bumpiness for the box using the "agate" in-built model // rotate: Rotates the box box { <-0.5, -0.5, -0.5>, <0.5, 0.5, 0.5> texture { pigment { color Red } finish { specular 0.6 } normal { agate 0.25 scale 1/2 } } rotate <45,46,47> } </syntaxhighlight> The following script fragment shows the use of variable declaration, assignment, comparison and the while loop construct: [[Image:I example povray scene rendering2.png|thumb|right|POV-Ray image output based on the script]] <syntaxhighlight lang="pov"> #declare the_angle = 0; #while (the_angle < 360) box { <-0.5, -0.5, -0.5> <0.5, 0.5, 0.5> texture { pigment { color Red } finish { specular 0.6 } normal { agate 0.25 scale 1/2 } } rotate the_angle } #declare the_angle = the_angle + 45; #end </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)