| 12
 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
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 
 | 
<!--  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>3.3.1 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_99.html"><img alt="previous" border="0" src="prev.png"></a> 
   
  </td>
   
  <td align="left" valign="middle" width="30%">
    <a href="s_99.html">3.3 Scene Settings</a> 
  </td>
   
  <td align="center" valign="middle">
    <strong class="NavBar">POV-Ray 3.6 for UNIX documentation</strong><br> <strong>3.3.1 
   Camera</strong> 
  </td>
   
  <td align="right" valign="middle" width="30%">
    <a href="s_101.html">3.3.2 Atmospheric Effects</a> 
  </td>
   
  <td align="right" nowrap="" valign="middle" width="32">
    <a href="s_101.html"><img alt="next" border="0" src="next.png"></a> 
   
  </td>
   
 </tr>
  
</table>
 
<h3><a name="s03_03_01">3.3.1 </a>Camera</h3>
<a name="s03_03_01_i1"><a name="camera"></a><a name="s03_03_01_i2"><a name="camera, keyword"></a><a name="s03_03_01_i3"><a name="s03_03_01_i4"><a name="perspective, camera"></a><a name="s03_03_01_i5"><a name="s03_03_01_i6"><a name="orthographic, camera"></a><a name="s03_03_01_i7"><a name="s03_03_01_i8"><a name="fisheye, camera"></a><a name="s03_03_01_i9"><a name="s03_03_01_i10"><a name="ultra_wide_angle, camera"></a><a name="s03_03_01_i11"><a name="s03_03_01_i12"><a name="omnimax, camera"></a><a name="s03_03_01_i13"><a name="s03_03_01_i14"><a name="panoramic, camera"></a><a name="s03_03_01_i15"><a name="s03_03_01_i16"><a name="cylinder, camera"></a><a name="s03_03_01_i17"><a name="s03_03_01_i18"><a name="spherical, camera"></a><a name="s03_03_01_i19"><a name="s03_03_01_i20"><a name="location, camera"></a><a name="s03_03_01_i21"><a name="s03_03_01_i22"><a name="right, camera"></a><a name="s03_03_01_i23"><a name="s03_03_01_i24"><a name="up, camera"></a><a name="s03_03_01_i25"><a name="s03_03_01_i26"><a name="direction, camera"></a><a name="s03_03_01_i27"><a name="s03_03_01_i28"><a name="sky, camera"></a><a name="s03_03_01_i29"><a name="s03_03_01_i30"><a name="angle, camera"></a><a name="s03_03_01_i31"><a name="s03_03_01_i32"><a name="look_at, camera"></a><a name="s03_03_01_i33"><a name="s03_03_01_i34"><a name="blur_samples, camera"></a><a name="s03_03_01_i35"><a name="s03_03_01_i36"><a name="aperture, camera"></a><a name="s03_03_01_i37"><a name="s03_03_01_i38"><a name="focal_point, camera"></a><a name="s03_03_01_i39"><a name="s03_03_01_i40"><a name="confidence, camera"></a><a name="s03_03_01_i41"><a name="s03_03_01_i42"><a name="variance, camera"></a><a name="s03_03_01_i43">
<p>
  The camera definition describes the position, projection type and properties of the camera viewing the scene. Its 
 syntax is: 
</p>
<pre>
CAMERA:
    camera{ [CAMERA_ITEMS...] }
CAMERA_ITEM:
    CAMERA_TYPE | CAMERA_VECTOR | CAMERA_MODIFIER |
    CAMERA_IDENTIFIER
CAMERA_TYPE:
    perspective | orthographic | fisheye | ultra_wide_angle |
    omnimax | panoramic | cylinder CylinderType | spherical
CAMERA_VECTOR:
    location <Location> | right <Right> | up <Up> | 
    direction <Direction> | sky <Sky>
CAMERA_MODIFIER:
    angle HORIZONTAL [VERTICAL] | look_at <Look_At> |
    blur_samples Num_of_Samples | aperture Size |
    focal_point <Point> | confidence Blur_Confidence |
    variance Blur_Variance | NORMAL | TRANSFORMATION
</pre>
<p>
  Camera default values: <a name="s03_03_01_i44"> 
</p>
<pre>
DEFAULT CAMERA:
  camera {
    perspective
    location <0,0,0>
    direction <0,0,1>
    right 1.33*x
    up y
    sky <0,1,0>
  }
CAMERA TYPE: perspective
angle      : ~67.380 ( direction_length=0.5*
                       right_length/tan(angle/2) )
confidence : 0.9 (90%)
direction  : <0,0,1>
focal_point: <0,0,0>
location   : <0,0,0>
look_at    : z
right      : 1.33*x
sky        : <0,1,0>
up         : y
variance   : 1/128
</pre>
<p>
  Depending on the projection type zero or more of the parameters are required: 
</p>
<ul>
 
 <li>
   If no camera is specified the default camera is used. 
 </li>
 <li>
   If no projection type is given the perspective camera will be used (pinhole camera). 
 </li>
 <li>
   The <em>CAMERA_TYPE</em> has to be the first item in the camera statement. 
 </li>
 <li>
   Other <em>CAMERA_ITEMs</em> may legally appear in any order. 
 </li>
 <li>
   For other than the perspective camera, the minimum that has to be specified is the CAMERA_TYPE, the cylindrical 
  camera also requires the <em>CAMERA_TYPE</em> to be followed by a float. 
 </li>
 <li>
   The Orthographic camera has two 'modes'. For the pure orthographic projection up or right have to be specified. 
  For an orthographic camera, with the same area of view as a perspective camera at the plane which goes through the 
  look_at point, the angle keyword has to be use. A value for the angle is optional. 
 </li>
 <li>
   All other <em>CAMERA_ITEM</em>s are taken from the default camera, unless they are specified differently. 
 </li>
</ul>
<h4><a name="s03_03_01_01">3.3.1.1 </a>Placing the Camera</h4>
<a name="s03_03_01_01_i1"><a name="s03_03_01_01_i2">
<p>
  The POV-Ray camera has ten different models, each of which uses a different projection method to project the scene 
 onto your screen. Regardless of the projection type all cameras use the <code>location</code>, <code> right</code>, <code>up</code>, 
 <code>direction</code>, and keywords to determine the location and orientation of the camera. The type keywords and 
 these four vectors fully define the camera. All other camera modifiers adjust how the camera does its job. The meaning 
 of these vectors and other modifiers differ with the projection type used. A more detailed explanation of the camera 
 types follows later. In the sub-sections which follows, we explain how to place and orient the camera by the use of 
 these four vectors and the <code>sky</code> and <code> look_at</code> modifiers. You may wish to refer to the 
 illustration of the perspective camera below as you read about these vectors.<br><center><img alt="The perspective camera." src="images/reference/perspcam.png"></center> 
 
</p>
<h5><a name="s03_03_01_01_01">3.3.1.1.1 </a>Location and Look_At</h5>
<a name="s03_03_01_01_01_i1"><a name="location"></a><a name="s03_03_01_01_01_i2"><a name="look_at"></a>
<p>
  Under many circumstances just two vectors in the camera statement are all you need to position the camera: <code>location</code> 
 and <code>look_at</code> vectors. For example: 
</p>
<pre>
 camera {
  location <3,5,-10>
  look_at <0,2,1>
 }
</pre>
<p>
  The location is simply the x, y, z coordinates of the camera. The camera can be located anywhere in the ray-tracing 
 universe. The default location is <code><0,0,0></code>. The <code>look_at</code> vector tells POV-Ray to pan and 
 tilt the camera until it is looking at the specified x, y, z coordinates. By default the camera looks at a point one 
 unit in the z-direction from the location. 
</p>
<p>
  The <code>look_at</code> modifier should almost always be the last item in the camera statement. If other camera 
 items are placed after the <code> look_at</code> vector then the camera may not continue to look at the specified 
 point. 
</p>
<h5><a name="s03_03_01_01_02">3.3.1.1.2 </a>The Sky Vector</h5>
<a name="s03_03_01_01_02_i1"><a name="s03_03_01_01_02_i2"><a name="sky"></a>
<p>
  Normally POV-Ray pans left or right by rotating about the y-axis until it lines up with the <code>look_at</code> 
 point and then tilts straight up or down until the point is met exactly. However you may want to slant the camera 
 sideways like an airplane making a banked turn. You may change the tilt of the camera using the <code>sky</code> 
 vector. For example: 
</p>
<pre>
 camera {
  location <3,5,-10>
  sky   <1,1,0>
  look_at <0,2,1>
 }
</pre>
<p>
  This tells POV-Ray to roll the camera until the top of the camera is in line with the sky vector. Imagine that the 
 sky vector is an antenna pointing out of the top of the camera. Then it uses the <code>sky</code> vector as the axis 
 of rotation left or right and then to tilt up or down in line with the <code>sky</code> until pointing at the <code>look_at</code> 
 point. In effect you are telling POV-Ray to assume that the sky isn't straight up. 
</p>
<p>
  The <code>sky</code> vector does nothing on its own. It only modifies the way the <code>look_at</code> vector turns 
 the camera. The default value is <code> sky<0,1,0></code>. 
</p>
<h5><a name="s03_03_01_01_03">3.3.1.1.3 </a>Angles</h5>
<a name="s03_03_01_01_03_i1"><a name="angle"></a><a name="s03_03_01_01_03_i2">
<p>
  The <code>angle</code> keyword followed by a float expression specifies the (horizontal) viewing angle in degrees 
 of the camera used. Even though it is possible to use the <code>direction</code> vector to determine the viewing angle 
 for the perspective camera it is much easier to use the <code> angle</code> keyword. 
</p>
<p>
  When you specify the <code>angle</code>, POV-Ray adjusts the length of the <code>direction</code> vector 
 accordingly. The formula used is <em> direction_length = 0.5 * right_length / tan(angle / 2)</em> where <em> 
 right_length</em> is the length of the <code>right</code> vector. You should therefore specify the <code> direction</code> 
 and <code> right</code> vectors before the <code> angle</code> keyword. The <code> right</code> vector is explained in 
 the next section. 
</p>
<p>
  There is no limitation to the viewing angle except for the perspective projection. If you choose viewing angles 
 larger than 360 degrees you will see repeated images of the scene (the way the repetition takes place depends on the 
 camera). This might be useful for special effects. 
</p>
<p>
  The <code>spherical</code> camera has the option to also specify a vertical angle. If not specified it defaults to 
 the horizontal angle/2 
</p>
<p>
  For example if you render an image with a 2:1 aspect ratio and map it to a sphere using spherical mapping, it will 
 recreate the scene. Another use is to map it onto an object and if you specify transformations for the object before 
 the texture, say in an animation, it will look like reflections of the environment (sometimes called environment 
 mapping). 
</p>
<h5><a name="s03_03_01_01_04">3.3.1.1.4 </a>The Direction Vector</h5>
<a name="s03_03_01_01_04_i1"><a name="s03_03_01_01_04_i2"><a name="direction"></a>
<p>
  You will probably not need to explicitly specify or change the camera <code>direction</code> vector but it is 
 described here in case you do. It tells POV-Ray the initial direction to point the camera before moving it with the <code>look_at</code> 
 or <code>rotate</code> vectors (the default value is <code>direction<0,0,1></code>). It may also be used to 
 control the (horizontal) field of view with some types of projection. The length of the vector determines the distance 
 of the viewing plane from the camera's location. A shorter <code>direction</code> vector gives a wider view while a 
 longer vector zooms in for close-ups. In early versions of POV-Ray, this was the only way to adjust field of view. 
 However zooming should now be done using the easier to use <code>angle</code> keyword. 
</p>
<p>
  If you are using the <code>ultra_wide_angle</code>, <code>panoramic</code>, or <code> cylindrical</code> projection 
 you should use a unit length <code> direction</code> vector to avoid strange results. The length of the <code> 
 direction</code> vector does not matter when using the <code> orthographic</code>, <code>fisheye</code>, or <code>omnimax</code> 
 projection types. 
</p>
<h5><a name="s03_03_01_01_05">3.3.1.1.5 </a>Up and Right Vectors</h5>
<a name="s03_03_01_01_05_i1"><a name="up"></a><a name="s03_03_01_01_05_i2"><a name="right"></a>
<p>
  The primary purpose of the <code>up</code> and <code>right</code> vectors is to tell POV-Ray the relative height 
 and width of the view screen. The default values are: 
</p>
<pre>
 right 4/3*x
 up y
</pre>
<p>
  In the default <code>perspective</code> camera, these two vectors also define the initial plane of the view screen 
 before moving it with the <code> look_at</code> or <code>rotate</code> vectors. The length of the <code> right</code> 
 vector (together with the <code>direction</code> vector) may also be used to control the (horizontal) field of view 
 with some types of projection. The <code>look_at</code> modifier changes both the <code>up</code> and <code>right</code> 
 vectors. The <code>angle</code> calculation depends on the <code> right</code> vector. 
</p>
<p>
  Most camera types treat the <code>up</code> and <code> right</code> vectors the same as the <code>perspective</code> 
 type. However several make special use of them. In the <code>orthographic</code> projection: The lengths of the <code> 
 up</code> and <code>right</code> vectors set the size of the viewing window regardless of the <code> direction</code> 
 vector length, which is not used by the orthographic camera. 
</p>
<p>
  When using <code>cylindrical</code> projection: types 1 and 3, the axis of the cylinder lies along the <code>up</code> 
 vector and the width is determined by the length of <code>right</code> vector or it may be overridden with the <code>angle</code> 
 vector. In type 3 the <code> up</code> vector determines how many units high the image is. For example if you have <code>up 
 4*y</code> on a camera at the origin. Only points from y=2 to y=-2 are visible. All viewing rays are perpendicular to 
 the y-axis. For type 2 and 4, the cylinder lies along the <code>right</code> vector. Viewing rays for type 4 are 
 perpendicular to the <code>right</code> vector. 
</p>
<p class="Note">
  <strong>Note:</strong> that the <code>up</code>, <code>right</code>, and <code> direction</code> 
 vectors should always remain perpendicular to each other or the image will be distorted. If this is not the case a 
 warning message will be printed. The vista buffer will not work for non-perpendicular camera vectors. 
</p>
<h5><a name="s03_03_01_01_06">3.3.1.1.6 </a>Aspect Ratio</h5>
<p>
  Together the <code>up</code> and <code>right</code> vectors define the <em>aspect ratio</em> (height to width 
 ratio) of the resulting image. The default values <code>up<0,1,0></code> and <code> right<1.33,0,0></code> 
 result in an aspect ratio of 4 to 3. This is the aspect ratio of a typical computer monitor. If you wanted a tall 
 skinny image or a short wide panoramic image or a perfectly square image you should adjust the <code>up</code> and <code>right</code> 
 vectors to the appropriate proportions. 
</p>
<p>
  Most computer video modes and graphics printers use perfectly square pixels. For example Macintosh displays and IBM 
 SVGA modes 640x480, 800x600 and 1024x768 all use square pixels. When your intended viewing method uses square pixels 
 then the width and height you set with the <code> Width</code> and <code>Height</code> options or <code>+W</code> or <code>+H</code> 
 switches should also have the same ratio as the <code>up</code> and <code>right</code> vectors. 
</p>
<p class="Note">
  <strong>Note:</strong> 640/480 = 4/3 so the ratio is proper for this square pixel mode. 
</p>
<p>
  Not all display modes use square pixels however. For example IBM VGA mode 320x200 and Amiga 320x400 modes do not 
 use square pixels. These two modes still produce a 4/3 aspect ratio image. Therefore images intended to be viewed on 
 such hardware should still use 4/3 ratio on their <code>up</code> and <code>right</code> vectors but the pixel 
 settings will not be 4/3. 
</p>
<p>
  For example: 
</p>
<pre>
 camera {
  location <3,5,-10>
  up    <0,1,0>
  right  <1,0,0>
  look_at <0,2,1>
 }
</pre>
<p>
  This specifies a perfectly square image. On a square pixel display like SVGA you would use pixel settings such as <code>+W480 
 +H480</code> or <code> +W600 +H600</code>. However on the non-square pixel Amiga 320x400 mode you would want to use 
 values of <code>+W240 +H400</code> to render a square image. 
</p>
<p>
  The bottom line issue is this: the <code>up</code> and <code> right</code> vectors should specify the artist's 
 intended aspect ratio for the image and the pixel settings should be adjusted to that same ratio for square pixels and 
 to an adjusted pixel resolution for non-square pixels. The <code> up</code> and <code>right</code> vectors should <em> 
 not</em> be adjusted based on non-square pixels. 
</p>
<h5><a name="s03_03_01_01_07">3.3.1.1.7 </a>Handedness</h5>
<a name="s03_03_01_01_07_i1"><a name="s03_03_01_01_07_i2">
<p>
  The <code>right</code> vector also describes the direction to the right of the camera. It tells POV-Ray where the 
 right side of your screen is. The sign of the <code>right</code> vector can be used to determine the handedness of the 
 coordinate system in use. The default value is: <code> right<1.33,0,0></code>. This means that the +x-direction 
 is to the right. It is called a <em>left-handed</em> system because you can use your left hand to keep track of the 
 axes. Hold out your left hand with your palm facing to your right. Stick your thumb up. Point straight ahead with your 
 index finger. Point your other fingers to the right. Your bent fingers are pointing to the +x-direction. Your thumb 
 now points into +y-direction. Your index finger points into the +z-direction. 
</p>
<p>
  To use a right-handed coordinate system, as is popular in some CAD programs and other ray-tracers, make the same 
 shape using your right hand. Your thumb still points up in the +y-direction and your index finger still points forward 
 in the +z-direction but your other fingers now say the +x-direction is to the left. That means that the right side of 
 your screen is now in the -x-direction. To tell POV-Ray to act like this you can use a negative x value in the <code> 
 right</code> vector such as: <code> right<-1.33,0,0></code>. Since having x values increasing to the left does 
 not make much sense on a 2D screen you now rotate the whole thing 180 degrees around by using a positive z value in 
 your camera's location. You end up with something like this. 
</p>
<pre>
 camera {
  location <0,0,10>
  up    <0,1,0>
  right  <-1.33,0,0>
  look_at <0,0,0>
 }
</pre>
<p>
  Now when you do your ray-tracer's aerobics, as explained in the section "<a href="s_57.html#s02_02_01_01">Understanding 
 POV-Ray's Coordinate System</a>", you use your right hand to determine the direction of rotations. 
</p>
<p>
  In a two dimensional grid, x is always to the right and y is up. The two versions of handedness arise from the 
 question of whether z points into the screen or out of it and which axis in your computer model relates to up in the 
 real world. 
</p>
<p>
  Architectural CAD systems, like AutoCAD, tend to use the <em> God's Eye</em> orientation that the z-axis is the 
 elevation and is the model's up direction. This approach makes sense if you are an architect looking at a building 
 blueprint on a computer screen. z means up, and it increases towards you, with x and y still across and up the screen. 
 This is the basic right handed system. 
</p>
<p>
  Stand alone rendering systems, like POV-Ray, tend to consider you as a participant. You are looking at the screen 
 as if you were a photographer standing in the scene. The up direction in the model is now y, the same as up in the 
 real world and x is still to the right, so z must be depth, which increases away from you into the screen. This is the 
 basic left handed system. 
</p>
<h5><a name="s03_03_01_01_08">3.3.1.1.8 </a>Transforming the Camera</h5>
<p>
  The various transformations such as <code>translate</code> and <code> rotate</code> modifiers can re-position the 
 camera once you have defined it. For example: 
</p>
<pre>
 camera {
  location < 0, 0, 0>
  direction < 0, 0, 1>
  up    < 0, 1, 0>
  right   < 1, 0, 0>
  rotate  <30, 60, 30>
  translate < 5, 3, 4>
 }
</pre>
<p>
  In this example, the camera is created, then rotated by 30 degrees about the x-axis, 60 degrees about the y-axis 
 and 30 degrees about the z-axis, then translated to another point in space. 
</p>
<h4><a name="s03_03_01_02">3.3.1.2 </a>Types of Projection</h4>
<a name="s03_03_01_02_i1">
<p>
  The following list explains the different projection types that can be used with the camera. The most common types 
 are the perspective and orthographic projections. The <em>CAMERA_TYPE</em> should be the <em>first</em> item in a <code>camera</code> 
 statement. If none is specified, the <code>perspective</code> camera is the default. 
</p>
<p>
  You should note that the vista buffer can only be used with the perspective and orthographic camera. 
</p>
<h5><a name="s03_03_01_02_01">3.3.1.2.1 </a>Perspective projection</h5>
<a name="s03_03_01_02_01_i1"><a name="perspective"></a><a name="s03_03_01_02_01_i2">
<p>
  The <code>perspective</code> keyword specifies the default perspective camera which simulates the classic pinhole 
 camera. The (horizontal) viewing angle is either determined by the ratio between the length of the <code>direction</code> 
 vector and the length of the <code> right</code> vector or by the optional keyword <code>angle</code>, which is the 
 preferred way. The viewing angle has to be larger than 0 degrees and smaller than 180 degrees. See the figure in 
 "Placing the Camera" for the geometry of the perspective camera. 
</p>
<h5><a name="s03_03_01_02_02">3.3.1.2.2 </a>Orthographic projection</h5>
<a name="s03_03_01_02_02_i1"><a name="orthographic"></a><a name="s03_03_01_02_02_i2">
<p>
  The orthographic camera offers two modes of operation: 
</p>
<p>
  The pure <code>orthographic</code> projection. This projection uses parallel camera rays to create an image of the 
 scene. The area of view is determined by the lengths of the <code>right</code> and <code>up</code> vectors. One of 
 these has to be specified, they are not taken from the default camera. If omitted the second method of the camera is 
 used. 
</p>
<p>
  If, in a perspective camera, you replace the <code>perspective</code> keyword by <code>orthographic</code> and 
 leave all other parameters the same, you will get an orthographic view with the same image area, i.e. the size of the 
 image is the same. The same can be achieved by adding the <code>angle</code> keyword to an orthographic camera. A 
 value for the angle is optional. So this second mode is active if no up and right are within the camera statement, or 
 when the angle keyword is within the camera statement. 
</p>
<p>
  You should be aware though that the visible parts of the scene change when switching from perspective to 
 orthographic view. As long as all objects of interest are near the look_at point they will be still visible if the 
 orthographic camera is used. Objects farther away may get out of view while nearer objects will stay in view. 
</p>
<p>
  If objects are too close to the camera location they may disappear. Too close here means, behind the orthographic 
 camera projection plane (the plane that goes through the <code>look_at</code> point). 
</p>
<h5><a name="s03_03_01_02_03">3.3.1.2.3 </a>Fisheye projection</h5>
<a name="s03_03_01_02_03_i1"><a name="fisheye"></a><a name="s03_03_01_02_03_i2">
<p>
  This is a spherical projection. The viewing angle is specified by the <code>angle</code> keyword. An angle of 180 
 degrees creates the "standard" fisheye while an angle of 360 degrees creates a super-fisheye 
 ("I-see-everything-view"). If you use this projection you should get a circular image. If this is not the 
 case, i.e. you get an elliptical image, you should read "Aspect Ratio". 
</p>
<h5><a name="s03_03_01_02_04">3.3.1.2.4 </a>Ultra wide angle projection</h5>
<a name="s03_03_01_02_04_i1"><a name="ultra_wide_angle"></a><a name="s03_03_01_02_04_i2">
<p>
  This projection is somewhat similar to the fisheye but it projects the image onto a rectangle instead of a circle. 
 The viewing angle can be specified using the <code>angle</code> keyword. 
</p>
<h5><a name="s03_03_01_02_05">3.3.1.2.5 </a>Omnimax projection</h5>
<a name="s03_03_01_02_05_i1"><a name="omnimax"></a><a name="s03_03_01_02_05_i2">
<p>
  The omnimax projection is a 180 degrees fisheye that has a reduced viewing angle in the vertical direction. In 
 reality this projection is used to make movies that can be viewed in the dome-like Omnimax theaters. The image will 
 look somewhat elliptical. The <code>angle</code> keyword is not used with this projection. 
</p>
<h5><a name="s03_03_01_02_06">3.3.1.2.6 </a>Panoramic projection</h5>
<a name="s03_03_01_02_06_i1"><a name="panoramic"></a><a name="s03_03_01_02_06_i2">
<p>
  This projection is called "cylindrical equirectangular projection". It overcomes the degeneration problem 
 of the perspective projection if the viewing angle approaches 180 degrees. It uses a type of cylindrical projection to 
 be able to use viewing angles larger than 180 degrees with a tolerable lateral-stretching distortion. The <code>angle</code> 
 keyword is used to determine the viewing angle. 
</p>
<h5><a name="s03_03_01_02_07">3.3.1.2.7 </a>Cylindrical projection</h5>
<a name="s03_03_01_02_07_i1"><a name="s03_03_01_02_07_i2">
<p>
  Using this projection the scene is projected onto a cylinder. There are four different types of cylindrical 
 projections depending on the orientation of the cylinder and the position of the viewpoint. A float value in the range 
 1 to 4 must follow the <code> cylinder</code> keyword. The viewing angle and the length of the <code> up</code> or <code>right</code> 
 vector determine the dimensions of the camera and the visible image. The camera to use is specified by a number. The 
 types are: 
</p>
<ol>
 
 <li>
   vertical cylinder, fixed viewpoint 
 </li>
 <li>
   horizontal cylinder, fixed viewpoint 
 </li>
 <li>
   vertical cylinder, viewpoint moves along the cylinder's axis 
 </li>
 <li>
   horizontal cylinder, viewpoint moves along the cylinder's axis 
 </li>
</ol>
<h5><a name="s03_03_01_02_08">3.3.1.2.8 </a>Spherical projection</h5>
<a name="s03_03_01_02_08_i1"><a name="s03_03_01_02_08_i2">
<p>
  Using this projection the scene is projected onto a sphere. <br>Syntax: 
</p>
<pre>
  camera {
    spherical
    [angle HORIZONTAL [VERTICAL]]
    [CAMERA_ITEMS...]
  }
</pre>
<p>
  The first value after <code>angle</code> sets the horizontal viewing angle of the camera. With the optional second 
 value, the vertical viewing angle is set: both in degrees. If the vertical angle is not specified, it defaults to half 
 the horizontal angle. 
</p>
<p>
  The spherical projection is similar to the fisheye projection, in that the scene is projected on a sphere. But 
 unlike the fisheye camera, it uses rectangular coordinates instead of polar coordinates; in this it works the same way 
 as spherical mapping (map_type 1). 
</p>
<p>
  This has a number of uses. Firstly, it allows an image rendered with the spherical camera to be mapped on a sphere 
 without distortion (with the fisheye camera, you first have to convert the image from polar to rectangular coordinates 
 in some image editor). Also, it allows effects such as "environment mapping", often used for simulating 
 reflections in scanline renderers. 
</p>
<h4><a name="s03_03_01_03">3.3.1.3 </a>Focal Blur</h4>
<a name="s03_03_01_03_i1"><a name="s03_03_01_03_i2"><a name="s03_03_01_03_i3"><a name="s03_03_01_03_i4"><a name="aperture"></a>
<p>
  POV-Ray can simulate focal depth-of-field by shooting a number of sample rays from jittered points within each 
 pixel and averaging the results. 
</p>
<p>
  To turn on focal blur, you must specify the <code>aperture</code> keyword followed by a float value which 
 determines the depth of the sharpness zone. Large apertures give a lot of blurring, while narrow apertures will give a 
 wide zone of sharpness. 
</p>
<p class="Note">
  <strong>Note:</strong> while this behaves as a real camera does, the values for aperture are purely 
 arbitrary and are not related to <em>f</em>-stops. 
</p>
<p>
  You must also specify the <code>blur_samples</code> keyword followed by an integer value specifying the maximum 
 number of rays to use for each pixel. More rays give a smoother appearance but is slower. By default no focal blur is 
 used, i. e. the default aperture is 0 and the default number of samples is 0.<a name="s03_03_01_03_i5"><a name="focal_point"></a> 
 
</p>
<p>
  The center of the <em>zone of sharpness</em> is specified by the <code> focal_point</code> vector. The <em>zone of 
 sharpness</em> is a plane through the <code>focal_point</code> and is parallel to the camera. Objects close to this 
 plane of focus are in focus and those farther from that plane are more blurred. The default value is <code> 
 focal_point<0,0,0></code>.<a name="s03_03_01_03_i6"><a name="blur_samples"></a> 
</p>
<p>
  Although <code>blur_samples</code> specifies the maximum number of samples, there is an adaptive mechanism that 
 stops shooting rays when a certain degree of confidence has been reached. At that point, shooting more rays would not 
 result in a significant change.<a name="s03_03_01_03_i7"><a name="variance"></a><a name="s03_03_01_03_i8"><a name="confidence"></a><a name="s03_03_01_03_i9"><a name="s03_03_01_03_i10"> 
 
</p>
<p>
  The <code>confidence</code> and <code> variance</code> keywords are followed by float values to control the 
 adaptive function. The <code>confidence</code> value is used to determine when the samples seem to be <em>close enough</em> 
 to the correct color. The <code> variance</code> value specifies an acceptable tolerance on the variance of the 
 samples taken so far. In other words, the process of shooting sample rays is terminated when the estimated color value 
 is very likely (as controlled by the confidence probability) near the real color value. 
</p>
<p>
  Since the <code>confidence</code> is a probability its values can range from 0 to <1 (the default is 0.9, i. e. 
 90%). The value for the <code> variance</code> should be in the range of the smallest displayable color difference 
 (the default is 1/128). If 1 is used POV-Ray will issue a warning and then use the default instead. 
</p>
<p>
  Rendering with the default settings can result in quite grainy images. This can be improved by using a lower <code>variance</code>. 
 A value of 1/10000 gives a fairly good result (with default confidence and blur_samples set to something like 100) 
 without being unacceptably slow. 
</p>
<p>
  Larger <code>confidence</code> values will lead to more samples, slower traces and better images. The same holds 
 for smaller <code>variance</code> thresholds. 
</p>
<h4><a name="s03_03_01_04">3.3.1.4 </a>Camera Ray Perturbation</h4>
<a name="s03_03_01_04_i1">
<p>
  The optional <code><a href="#l122">normal</a></code> may be used to assign a normal pattern to the camera. For 
 example: 
</p>
<pre>
 camera{
   location Here
   look_at There
   normal { bumps 0.5 }
 }
</pre>
<p>
  All camera rays will be perturbed using this pattern. The image will be distorted as though you were looking 
 through bumpy glass or seeing a reflection off of a bumpy surface. This lets you create special effects. See the 
 animated scene <code>camera2.pov</code> for an example. See "Normal" for information on normal patterns. 
</p>
<h4><a name="s03_03_01_05">3.3.1.5 </a>Camera Identifiers</h4>
<a name="s03_03_01_05_i1">
<p>
  Camera identifiers may be declared to make scene files more readable and to parameterize scenes so that changing a 
 single declaration changes many values. You may declare several camera identifiers if you wish. This makes it easy to 
 quickly change cameras. An identifier is declared as follows. 
</p>
<pre>
CAMERA_DECLARATION:
    #declare IDENTIFIER = CAMERA |
    #local IDENTIFIER = CAMERA
</pre>
<p>
  Where <em>IDENTIFIER</em> is the name of the identifier up to 40 characters long and <em>CAMERA</em> is any valid 
 camera statement. See "<a href="s_98.html#s03_02_02_02_02">#declare vs. #local</a>" for information on 
 identifier scope. Here is an example... 
</p>
<pre>
 #declare Long_Lens = camera {
    location -z*100
    look_at <0,0,0>
    angle 3
 }
 
 #declare Short_Lens = camera {
    location -z*50
    look_at <0,0,0>
    angle 15
 }
    
 camera {
    Long_Lens  // edit this line to change lenses
    translate <33,2,0>
 }
</pre>
<p class="Note">
  <strong>Note:</strong> only camera transformations can be added to an already declared camera. Camera 
 behaviour changing keywords are not allowed, as they are needed in an earlier stage for resolving the keyword order 
 dependencies. 
</p>
<p>
 <a name="l122">
<small><strong>More about "normal"</strong></small>
</a>
 <ul>
  
  <li><small>
   <a href="s_116.html#s03_05_02">3.5.2 Normal</a> in 3.5 Textures
  </small>
  <li><small>
   <a href="s_162.html#s03_08_10_05">3.8.10.5 Normal</a> in 3.8.10 Texture
  </small>
  <li><small>
   <a href="s_69.html#s02_03_04_02">2.3.4.2 Normals</a> in 2.3.4 Advanced Texture Options
  </small>
 </ul>
</p>
 <br> 
<table class="NavBar" width="100%">
  
 <tr>
   
  <td align="left" nowrap="" valign="middle" width="32">
    <a href="s_99.html"><img alt="previous" border="0" src="prev.png"></a> 
   
  </td>
   
  <td align="left" valign="middle" width="30%">
    <a href="s_99.html">3.3 Scene Settings</a> 
  </td>
   
  <td align="center" valign="middle">
    <strong>3.3.1 Camera</strong> 
  </td>
   
  <td align="right" valign="middle" width="30%">
    <a href="s_101.html">3.3.2 Atmospheric Effects</a> 
  </td>
   
  <td align="right" nowrap="" valign="middle" width="32">
    <a href="s_101.html"><img alt="next" border="0" src="next.png"></a> 
   
  </td>
   
 </tr>
  
</table>
 </body> </html>
 |