POV-Ray : Newsgroups : povray.general : enlarging canvas but not image : Re: enlarging canvas but not image Server Time
28 Jul 2024 20:27:53 EDT (-0400)
  Re: enlarging canvas but not image  
From: Chris B
Date: 4 Aug 2007 15:31:12
Message: <46b4d400@news.povray.org>
"T-n-T" <lil### [at] donobinet> wrote in message 
news:040820071031598961%lil### [at] donobinet...
>I have another seemingly simple problem I am pretty sure the someone
> here can answer. I have put together a simple scene, a tutorial for
> making a piece of jewelry, so it consists of multiple images each one
> with the next step added. I got to a point where my image goes off the
> 'canvas' I thought I could just resize the image size but that rescales
> my scene also, so now it is a different size than the rest of my
> images.
>
> So do I just need to resize the image and then zoom the camera out? If
> so is there some formula to keep the actual image the same size and
> just enlarge the canvas area? Example: if you go from canvas size of
> 300x300 to 500x500 to keep the picture the same size you need to zoom
> the camera out by X. What would X be? Maybe I am making a mountain out
> of an ant hill though.
> Thank you very much,
>
> lildog

I came up with the same scribbled guess as Christian, but checked it with 
POV-Ray (because I have less faith in my guesses).
So below is the POV-Ray equivalent.
67.380 is the default angle and you need to divide by two for using with 
tangents.

p.s. It's not necessary (and not really good form) to cross post onto both 
povray.general and povray.newusers.

Regards,
Chris B.

#include "math.inc"
#declare OriginalWidth = 640;
#declare CurrentWidth = image_width;

#declare CameraAngle = 
2*atan2d(CurrentWidth/OriginalWidth*tand(67.380/2),1);

camera {location -z look_at 0 angle CameraAngle}
light_source { <-2, 2, -20> color rgb <1,1,1>}

sphere {< 0.5*4/3, 0.5,0>,0.05 pigment {color rgb <8,0,0>}}
sphere {< 0.5*4/3,-0.5,0>,0.05 pigment {color rgb <8,0,0>}}
sphere {<-0.5*4/3,-0.5,0>,0.05 pigment {color rgb <8,0,0>}}
sphere {<-0.5*4/3, 0.5,0>,0.05 pigment {color rgb <8,0,0>}}


Post a reply to this message

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