POV-Ray

維基百科,自由的百科全書
跳至導覽 跳至搜尋
POV-Ray
File:POV-Ray SC.jpg
POV-Ray屏幕截圖(Windows XP)
開發者The POV-Team
當前版本3.7.0(2013年11月9日 (2013-11-09)
預覽版本3.7 rc3
原始碼庫
  • {{URL|example.com|可选的显示文本}}
Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
引擎
    Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
    作業系統WindowsMac OS Linux
    類型三維計算機圖形
    許可協議AGPLv3[1]
    網站www.povray.org

    POV-Ray,全名是Persistence of Vision Raytracer,是一個使用光線跟蹤繪製三維圖像的開放原始碼自由軟件。運行POV腳本語言。它是基於DKBTrace來開發的,DKBTrace是由David Kirk BuckAaron A. Collins編寫在Amiga上的。POV-Ray早期也受到了Polyray raytracer作者Alexander Enzmann的幫助。很多漂亮的圖片就是由POV-Ray來製作的。

    歷史[編輯]

    該軟件最初發展始於80年代,是一個歷史悠久的三維算圖引擎。David Kirk Buck下載了一個為Unix編寫的Amiga光線跟蹤軟件的原始碼。當他玩了一段時間後,他覺得應該自己寫一個類似軟件,以自己的名字縮寫命名為DKBTrace,以。於是他將它貼在了一個電子佈告欄上面,以為別人也許對它感興趣。1987年,Aaron Collins下載了DKBTrace然後開始了x86機器的移植工作。他和David Buck一起合作為它添加了更多功能。

    這個軟件越來越流行,他們已經為了加新功能而應付不過來。1989年7月,David把這個軟件變成了一個程式設計師團隊合作的項目。這時候,他覺得繼續用自己的名字來命名不甚妥當,因為他已不再維護此軟件。所以考慮了很多新的名字。最初打算使用「STAR-Light」(為動畫和渲染而生存的軟件:Software Taskforce on Animation and Rendering),但是最後變成了「持續不斷更新版本的光線跟蹤引擎Persistence of Vision Raytracer」,簡寫為「POV-Ray」。

    POV-Ray是第一個在空間軌道渲染出圖片的光線跟蹤軟件,由馬克·沙特爾沃思國際太空站渲染。

    特徵[編輯]

    POV-Ray不像一般的3D軟件有圖形化使用介面,其使用自有腳本語言來描述場景。POV腳本語言具備圖靈完備性,可以編寫巨集以及迴圈程式。

    • 支援幾種幾何元素以及構造實體幾何
    • 物件表面的折射、反射。
    • 支援TGA、PNG影像格式

    當前版本[編輯]

    最新的版本是3.7。

    基元[編輯]

    場景描述語言(Scene Description Language)例子[編輯]

    下面的例子給出了場景描述語言(Scene Description Language)在POV-Ray的一個應用實例。展示了使用視角,光源,一個簡單的方塊模型和縮放,旋轉,平移變換的效果。

    File:I example povray scene rendering.png
    POV-Ray根據左邊的腳本的對應輸出
    #version 3.6;
    #include "colors.inc"
    global_settings { assumed_gamma 1.0 }
    
    background   { color rgb <0.25, 0.25, 0.25> }
    
    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> }
    
    light_source { <0, 0, 0>
                   color rgb <1, 1, 1>
                   translate <-5, 5, -5> }
    
    light_source { <0, 0, 0>        
                   color rgb <0.25, 0.25, 0.25>
                   translate <6, -6, -6> }
    
    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> }
    

    下面的腳本片段展示了使用變量聲明,賦值,比較和while循環結構。

    File:I example povray scene rendering2.png
    POV-Ray根據左邊的腳本的對應輸出
    #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
    

    外在連結[編輯]