POV-Ray : Newsgroups : povray.binaries.images : 35mm Camera Macro : 35mm Camera Macro Server Time
4 Nov 2024 13:42:52 EST (-0500)
  35mm Camera Macro  
From: Edouard Poor
Date: 25 Feb 2009 06:35:01
Message: <web.49a52c329791b720bd47b0730@news.povray.org>
A simple macro I put together that approximates a 35mm camera in the scene.

Should do the correct field of view and a vaguely plausible focal blur. Feel
free to fix any obvious (and even not so obvious) flaws...

The example picture uses a 50mm lens at f1.4. The three balls are 100mm in
diameter, with the center ball 500mm from the camera. The checkerboard is 100mm
per square.

#macro Camera35mm( cam_pos, look_pos, focal_length, fstop, num_samples )
 #local film_width = 35;
 #local fov = degrees( atan( (film_width / 2) / focal_length ) * 2 );
 #local apertureDiameter = focal_length / fstop;
 #local focal_distance = vlength( look_pos - cam_pos);

 camera {
  perspective

  focal_point look_pos
  blur_samples num_samples
  aperture (apertureDiameter / focal_distance) * 1000  // Magic Number

  location cam_pos
  look_at look_pos
  angle fov
  right x * 1
  up y * image_height/image_width
 }
#end

Cheers,
Edouard.


Post a reply to this message


Attachments:
Download '50mm_f1.4.jpg' (136 KB)

Preview of image '50mm_f1.4.jpg'
50mm_f1.4.jpg


 

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