2017-02-12 50 views
1

我想用POV-Ray繪製以下內容。在POV-Ray中繪製半填充玻璃柱體

enter image description here

#include "colors.inc" 
#include "glass.inc" 
#include "textures.inc" 

global_settings { ambient_light color White} 

camera { 
    location <0, 0, -10> 
    right x*image_width/image_height 
    look_at<0, 0, 0> 
} 

background { White } 

#declare BEAKER_HEIGHT = 1;     
#declare cyclinder_xpos = 0; 

difference 
{ 
    cylinder 
    {  
     <cyclinder_xpos, -3, 0>, <cyclinder_xpos, BEAKER_HEIGHT, 0>, 1 
    } 
    cylinder 
    {  
     <cyclinder_xpos, -2.95, 0>, <cyclinder_xpos, BEAKER_HEIGHT-2, 0>, 0.89 
     texture { Water} 
    } 
    pigment 
    {  
     rgbt .8 
    } 
    finish 
    { 
     Glass_Finish 
    }  
} 

如果cyclinder_xpos = 0,其結果是

enter image description here

如果cyclinder_xpos = 5,其結果是

enter image description here

如果位置發生變化,氣缸就會更換。如何移動氣缸而不失真?

回答

1

爲了避免失真,考慮使用orthographic相機,作爲默認的一個是perspective

camera { 
    orthographic 
    location <0, 0, -10> 
    up <0, 10, 0> // these two options... 
    right <10, 0, 0> // will define the viewport's size 
    look_at<0, 0, 0> 
}