File: s_62.html

package info (click to toggle)
povray 1%3A3.6.1-6
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 31,052 kB
  • ctags: 20,305
  • sloc: ansic: 110,032; cpp: 86,573; sh: 13,595; pascal: 5,942; asm: 2,994; makefile: 1,747; ada: 1,637
file content (194 lines) | stat: -rw-r--r-- 6,361 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194

<!--  This file copyright Persistence of Vision Raytracer Pty. Ltd. 2003-2004  -->
<html> 
<head>
  
<!--  NOTE: In order to users to help find information about POV-Ray using  -->
 
<!--  web search engines, we ask you to *not* let them index documentation  -->
 
<!--  mirrors because effectively, when searching, users will get hundreds  -->
 
<!--  of results containing the same information! For this reason, the two  -->
 
<!--  meta tags below disable archiving and indexing of this page by all  -->
 
<!--  search engines that support these meta tags.  -->
 
 <meta content="noarchive" name="robots">
   
 <meta content="noindex" name="robots">
   
 <meta content="no-cache" http-equiv="Pragma">
   
 <meta content="0" http-equiv="expires">
   
<title>2.2.6 Using the Camera</title>
 <link href="povray35.css" rel="stylesheet" type="text/css"> 
</head>
 <body> 
<table class="NavBar" width="100%">
  
 <tr>
   
  <td align="left" nowrap="" valign="middle" width="32">
    <a href="s_61.html"><img alt="previous" border="0" src="prev.png"></a> 
   
  </td>
   
  <td align="left" valign="middle" width="30%">
    <a href="s_61.html">2.2.5 Simple Texture Options</a> 
  </td>
   
  <td align="center" valign="middle">
    <strong class="NavBar">POV-Ray 3.6 for UNIX documentation</strong><br> <strong>2.2.6 
   Using the Camera</strong> 
  </td>
   
  <td align="right" valign="middle" width="30%">
    <a href="s_63.html">2.2.7 POV-Ray Coordinate System</a> 
  </td>
   
  <td align="right" nowrap="" valign="middle" width="32">
    <a href="s_63.html"><img alt="next" border="0" src="next.png"></a> 
   
  </td>
   
 </tr>
  
</table>
 
<h3><a name="s02_02_06">2.2.6 </a>Using the Camera</h3>
<a name="s02_02_06_i1">
<h4><a name="s02_02_06_01">2.2.6.1 </a>Using Focal Blur</h4>
<a name="s02_02_06_01_i1"><a name="s02_02_06_01_i2">
<p>
  Let's construct a simple scene to illustrate the use of focal blur. For this example we will use a pink sphere, a 
 green box and a blue cylinder with the sphere placed in the foreground, the box in the center and the cylinder in the 
 background. A checkered floor for perspective and a couple of light sources will complete the scene. We create a new 
 file called <code> focaldem.pov</code> and enter the following text 
</p>

<pre>
  #include &quot;colors.inc&quot;
  #include &quot;shapes.inc&quot;
  #include &quot;textures.inc&quot;
  sphere {
    &lt;1, 0, -6&gt;, 0.5
    finish {
      ambient 0.1
      diffuse 0.6
    }
    pigment { NeonPink }
  }
  box {
    &lt;-1, -1, -1&gt;, &lt; 1,  1,  1&gt;
    rotate &lt;0, -20, 0&gt;
    finish {
      ambient 0.1
      diffuse 0.6
    }
    pigment { Green }
  }
  cylinder {
    &lt;-6, 6, 30&gt;, &lt;-6, -1, 30&gt;, 3
    finish {
      ambient 0.1
      diffuse 0.6
    }
    pigment {NeonBlue}
  }
  plane {
    y, -1.0
    pigment {
      checker color Gray65 color Gray30
    }
  }
  light_source { &lt;5, 30, -30&gt; color White }
  light_source { &lt;-5, 30, -30&gt; color White }
</pre>

<p>
  Now we can proceed to place our focal blur camera to an appropriate viewing position. Straight back from our three 
 objects will yield a nice view. Adjusting the focal point will move the point of focus anywhere in the scene. We just 
 add the following lines to the file: 
</p>

<pre>
  camera {
    location &lt;0.0, 1.0, -10.0&gt;
    look_at  &lt;0.0, 1.0,  0.0&gt;
  //  focal_point &lt;-6, 1, 30&gt;    // blue cylinder in focus
  //  focal_point &lt; 0, 1,  0&gt;    // green box in focus
    focal_point &lt; 1, 1, -6&gt;    // pink sphere in focus
    aperture 0.4     // a nice compromise
  //  aperture 0.05    // almost everything is in focus
  //  aperture 1.5     // much blurring
  //  blur_samples 4       // fewer samples, faster to render
    blur_samples 20      // more samples, higher quality image
  }
</pre>

<p>
  The focal point is simply the point at which the focus of the camera is at its sharpest. We position this point in 
 our scene and assign a value to the aperture to adjust how close or how far away we want the focal blur to occur from 
 the focused area. 
</p>

<p>
  The aperture setting can be considered an <em>area of focus</em>. Opening up the aperture has the effect of making 
 the area of focus smaller while giving the aperture a smaller value makes the area of focus larger. This is how we 
 control where focal blur begins to occur around the focal point. 
</p>

<p>
  The blur samples setting determines how many rays are used to sample each pixel. Basically, the more rays that are 
 used the higher the quality of the resultant image, but consequently the longer it takes to render. Each scene is 
 different so we have to experiment. This tutorial has examples of 4 and 20 samples but we can use more for high 
 resolution images. We should not use more samples than is necessary to achieve the desired quality - more samples take 
 more time to render. The confidence and variance settings are covered in section &quot;<a href="s_100.html#s03_03_01_03">Focal 
 Blur</a>&quot;. 
</p>

<p>
  We experiment with the focal point, aperture, and blur sample settings. The scene has lines with other values that 
 we can try by commenting out the default line with double slash marks and un-commenting the line we wish to try out. 
 We make only one change at a time to see the effect on the scene. 
</p>

<p>
  Two final points when tracing a scene using a focal blur camera. We need not specify anti-aliasing because the 
 focal blur code uses its own sampling method that automatically takes care of anti-aliasing. Focal blur can only be 
 used with the perspective camera. 
</p>
 <br> 
<table class="NavBar" width="100%">
  
 <tr>
   
  <td align="left" nowrap="" valign="middle" width="32">
    <a href="s_61.html"><img alt="previous" border="0" src="prev.png"></a> 
   
  </td>
   
  <td align="left" valign="middle" width="30%">
    <a href="s_61.html">2.2.5 Simple Texture Options</a> 
  </td>
   
  <td align="center" valign="middle">
    <strong>2.2.6 Using the Camera</strong> 
  </td>
   
  <td align="right" valign="middle" width="30%">
    <a href="s_63.html">2.2.7 POV-Ray Coordinate System</a> 
  </td>
   
  <td align="right" nowrap="" valign="middle" width="32">
    <a href="s_63.html"><img alt="next" border="0" src="next.png"></a> 
   
  </td>
   
 </tr>
  
</table>
 </body> </html>