POV-Ray : Newsgroups : povray.advanced-users : Calculating aperture using f-stops : Calculating aperture using f-stops Server Time
29 Jul 2024 02:28:19 EDT (-0400)
  Calculating aperture using f-stops  
From: Matti Karnaattu
Date: 21 Mar 2003 13:00:06
Message: <web.3e7b52af75efcf28bef0bd7d0@news.povray.org>
f-values in camera is calculated using formula:

  f = focal_length / lens_diameter

We know that focal blur on Pov-Ray is maded shooting rays from cube and cube
side width is aperture value. We have to calculate some area where to shoot
rays. If we draw light rays in camera (real world camera) and straight line
from center of lens to focal point we can see angle between line and focal
point. The angle can be solved using atan:

  tan(angle) = (lens_diameter / 2) / focal_length

  tan(angle) = 1 / (f * 2)

  angle = atan(1 / (f * 2))

Using this angle we can draw a lens as circle if we know focal_length. If we
use this angle in focal point outside the camera, we can draw area as
sphere where to shot rays to get focal blur.

  r = distance_to_focal_point * tan(angle)

  r = distance_to_focal_point * tan(atan(1 / (2 * f))

  r = distance_to_focal_point / (f * 2)

Aperture area in Pov-Ray is cube. We have to solve equation to get cube side
width from sphere volume.

  x ^ 3 = pi * r ^ 3 * 4 / 3

  x = r * (pi * 36) ^ (1/3) / 3


Final equation when we put distance_to_focal_point / (f * 2) to r is:

  aperture = distance_to_focal_point / (f * 2) * (pi * 36) ^ (1/3) / 3

After simplify:

  aperture = distance_to_focal_point * (pi * 36) ^ (1/3) / (f * 6)


Comments and corrections please.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.