This is a file from the Wikimedia Commons

File:Camera focal length distance house animation.gif

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Camera_focal_length_distance_house_animation.gif(512 × 512 pixels, file size: 3.68 MB, MIME type: image/gif, looped, 60 frames, 6.8 s)

Summary[edit]

Description
English: This computer simulation shows how adjusting a camera's distance and focal length, while keeping the object in frame, can introduce geometric distortions (called foreshortening) into the image. It was rendered in POV-Ray 3.7.0.
Date
Source Own work
Author SharkD
Other versions

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following licenses:
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International, 3.0 Unported, 2.5 Generic, 2.0 Generic and 1.0 Generic license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
  • share alike – If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

You may select the license of your choice.

POV-Ray source code[edit]

// Title: Camera focal length animation
// Author: Michael Horvath, http://isometricland.net
// Created: 2015-11-19
// Updated: 2016-11-09
// This file is licensed under the terms of the GFDL.
// +kfi0 +kff18 +a0.0
// +kfi0 +kff30
// +K0.5

#version 3.7
#include "axes_macro.inc"	// available from the POV-Ray Object Collection
#include "screen.inc"		// requires the updated version available here: http://news.povray.org/povray.binaries.scene-files/thread/%3C4afccd8a%241%40news.povray.org%3E/
#include "math.inc"
#include "Transforms.inc"
#declare SceneUnits = 8;

global_settings
{
	assumed_gamma	1.0
	adc_bailout	0.005
	max_trace_level	50
	charset		utf8
	ambient_light	0
	radiosity
	{
		pretrace_start	0.08
		pretrace_end	0.01
		count		50
		error_bound	0.1
		recursion_limit	1
		normal		on
		brightness	0.8
		always_sample	yes
		gray_threshold	0.8
		media		on
	}
}

background {color srgb <096,144,255,>/255}

//#debug "frame\tangle\tdistance\n"
#if (clock = 0)
	#declare CameraAngle		= 0;
	#declare CameraRightLength	= 5/2;
	#declare CameraRight		= +x * CameraRightLength;
	#declare CameraUp		= +y * CameraRightLength;
	#declare CameraDistance		= 1024;
	#declare CameraLocation		= -z * CameraDistance;
	#declare CameraDirection	= +z * CameraDistance;
	#declare CameraString0		= str(frame_number,0,0);
	#declare CameraString1		= "0°";
	#declare CameraString2		= "inf.";
	#declare CameraTransform	= transform
	{
		rotate	<atand(sind(45)),45,0>
		translate y/4
	}
	#declare CameraText1		= text
	{
		ttf "verdana.ttf" CameraString1 0.01, <0,0>
		scale 0.05
	}
	#declare CameraText2		= text
	{
		ttf "verdana.ttf" CameraString2 0.01, <0,0>
		scale 0.05
	}
	Set_Camera_Orthographic(1)
	Set_Camera_Alt(CameraLocation, CameraDirection, CameraRight, CameraUp)
	Set_Camera_Transform(CameraTransform)
	#debug concat("", CameraString0, "\t", CameraString1, "\t", CameraString2, "\n")
#else
	#declare CameraAngle		= clock * 90;
	#declare CameraRightLength	= 5/2;
	#declare CameraRight		= +x * CameraRightLength;
	#declare CameraUp		= +y * CameraRightLength;
	#declare CameraDistance		= CameraRightLength/tand(CameraAngle/2)/2;
	#declare CameraLocation		= -z * CameraDistance;
	#declare CameraDirection	= +z * CameraDistance;
	#declare CameraString0		= str(frame_number,0,0);
	#declare CameraString1		= concat("", str(CameraAngle,0,0), "°");
	#declare CameraString2		= concat("", str(CameraDistance*SceneUnits,0,3), "m");
	#declare CameraTransform	= transform
	{
		rotate	<atand(sind(45)),45,0>
		translate y/4
	}
	#declare CameraText1		= text
	{
		ttf "verdana.ttf" CameraString1 0.01, <0,0>
		scale 0.05
	}
	#declare CameraText2		= text
	{
		ttf "verdana.ttf" CameraString2 0.01, <0,0>
		scale 0.05
	}
	Set_Camera_Orthographic(0)
	Set_Camera_Alt(CameraLocation, CameraDirection, CameraRight, CameraUp)
	Set_Camera_Transform(CameraTransform)
	#debug concat("", CameraString0, "\t", CameraString1, "\t", CameraString2, "\n")
#end
/*
union
{
	Screen_Object(CameraText1, <1,0>, <0.04,0.07>, true, 0.01)
	Screen_Object(CameraText2, <1,0>, <0.04,0.02>, true, 0.01)
}
*/
camera
{
	#if (clock = 0)
		orthographic
	#end
	location		CameraLocation
	direction		CameraDirection
	up			CameraUp
	right			CameraRight
/*
	// causes screen text to disappear
	#if (clock != 0)
		focal_point		-z * sqrt(3)/2
//		focal_point		<0,0,0>
		aperture		1/16	// 0.05 ~ 1.5; // more = more blurring 
		blur_samples		128	// 4 ~ 100, more = higher quality; fewer = faster
		confidence		0.9	// how close to the correct color, 0 ~ 1, default 0.9
		variance		1/128	//(default) smallest displayable color difference
	#end
*/
	transform {CameraTransform}
}

light_source
{
	<-32,+32,-32,>
	color		rgb 1
	rotate		y * 330
	parallel
	point_at	0
	shadowless
}

light_source
{
	<-32,+32,-32,>
	color		rgb 1
	rotate		y * 090
	parallel
	point_at	0
//	shadowless
}

// the coordinate grid and axes
Axes_Macro
(
	50000,		// Axes_axesSize,	The distance from the origin to one of the grid's edges.		(float)
	1/SceneUnits,	// Axes_majUnit,	The size of each large-unit square.					(float)
	10,		// Axes_minUnit,	The number of small-unit squares that make up a large-unit square.	(integer)
	0.0000001,	// Axes_thickRatio,	The thickness of the grid lines, as a factor of axesSize.		(float)
	off,		// Axes_aBool,		Turns the axes on/off. 							(boolian)
	off,		// Axes_mBool,		Turns the minor units on/off. 						(boolian)
	off,		// Axes_xBool,		Turns the plane perpendicular to the x-axis on/off.			(boolian)
	on,		// Axes_yBool,		Turns the plane perpendicular to the y-axis on/off.			(boolian)
	off		// Axes_zBool,		Turns the plane perpendicular to the z-axis on/off.			(boolian)
)

object
{
	Axes_Object
//	translate -0.000001
}

merge
{
	// main structure
	intersection
	{
		plane {+x + y,0 translate +y * 3/4}
		plane {-x + y,0 translate +y * 3/4}
		box {-1, +1}
		translate	+y
		scale		1/2
	}
	// chimney
	box {<0,0,0,>,<+1/8,+8/8,+1/8>}
	// doorway and floor clip
	clipped_by
	{
		merge
		{
			box {<-1/8, +0/8, -8/8,>, <+1/8, +2/8, +8/8> inverse}
			plane {+y, -0.1}
		}
	}
	hollow
	pigment {color srgbt <1/1,1/1,1/1,1/2>}
}
Povray logo sphere.png
This image was created with POV-Ray

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current03:42, 10 November 2016Thumbnail for version as of 03:42, 10 November 2016512 × 512 (3.68 MB)SharkDReverted to version as of 08:44, 12 December 2015 (UTC)
02:34, 10 November 2016Thumbnail for version as of 02:34, 10 November 2016512 × 512 (3.8 MB)SharkDAdded focal blur.
08:44, 12 December 2015Thumbnail for version as of 08:44, 12 December 2015512 × 512 (3.68 MB)SharkDAdd more frames. Remove duplicate frames. Increase pause at each end of the cycle.
02:26, 10 December 2015Thumbnail for version as of 02:26, 10 December 2015512 × 512 (2.3 MB)SharkDForgot to turn radiosity back on.
01:29, 10 December 2015Thumbnail for version as of 01:29, 10 December 2015512 × 512 (2.2 MB)SharkDSet frames to correspond to increments of 5 degrees.
07:51, 24 November 2015Thumbnail for version as of 07:51, 24 November 2015512 × 512 (1.85 MB)SharkDAdjust grid to match the other images. Increase precision of measurements to two decimal places.
13:59, 21 November 2015Thumbnail for version as of 13:59, 21 November 2015512 × 512 (2.13 MB)SharkDZoom in less far. Speed up animation.
02:43, 20 November 2015Thumbnail for version as of 02:43, 20 November 2015512 × 512 (2.12 MB)SharkDNicer render.
06:00, 19 November 2015Thumbnail for version as of 06:00, 19 November 2015512 × 512 (1.99 MB)SharkDUser created page with UploadWizard

Global file usage

The following other wikis use this file: