POV-Ray : Newsgroups : povray.pov4.discussion.general : New camera, or new camera docs illustrations. : Re: New camera, or new camera docs illustrations. Server Time
14 Apr 2024 04:03:27 EDT (-0400)
  Re: New camera, or new camera docs illustrations.  
From: SharkD
Date: 10 Aug 2009 17:04:15
Message: <4a808b4f@news.povray.org>
gregjohn wrote:
> It took me 13 years of povving to understand the camera. That is, to come up
> with the code for a box which exactly fills the screen, regardless of camera
> angle/ distance and image aspect ratio.

I don't see what the difficulty is. It's as simple as this:

camera
{
	location	<0,0,-4>
	direction	<0,0,+4>	// reciprocal of location
	up		y
	right		x*image_width/image_height
}

// polygon centered on the origin with sides of length 1
polygon
{
	4, <-1/2,-1/2>, <-1/2,+1/2>, <+1/2,+1/2>, <+1/2,-1/2>
	pigment {color Red}	
}

The trick here is to not use the angle and look_at keywords. In this 
case, they're more trouble than they're worth. Also, if you omit the 
image_width/image_height stuff, then it fills the viewport *exactly*, 
regardless of the aspect ratio.

-Mike


Post a reply to this message

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