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'
|