POV-Ray : Newsgroups : povray.general : enlarging canvas but not image Server Time
5 Nov 2024 07:16:55 EST (-0500)
  enlarging canvas but not image (Message 1 to 10 of 10)  
From: T-n-T
Subject: enlarging canvas but not image
Date: 4 Aug 2007 13:34:38
Message: <040820071031598961%lildog@donobi.net>
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


Post a reply to this message

From: Christian Froeschlin
Subject: Re: enlarging canvas but not image
Date: 4 Aug 2007 15:11:12
Message: <46b4cf50$1@news.povray.org>
Typically, you don't want your image to change just because you render
a high quality version of it. If you want the image with more pixels to
also reveal more of the scene you need to adapt the camera settings.
Using an ortographic camera you can simply scale the right and up
vectors of the camera linearly with the number of pixels (in your
example by 500/300). With a perspective camera you could try
newangle = atan((500/300)*tan(oldangle)), but that's just my
guess from a scribbled triangle.


Post a reply to this message

From: Tim Attwood
Subject: Re: enlarging canvas but not image
Date: 4 Aug 2007 15:16:05
Message: <46b4d075$1@news.povray.org>
>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,

You can just change the right and up of your camera by the increased
"canvas" ratio.

So for your example you'd multiply right and up by 5/3 ...
camera {
   location  <...>
   right     x*image_width/image_height*(5/3)
   up y*(5/3)
   look_at   <...>
}


Post a reply to this message

From: St 
Subject: Re: enlarging canvas but not image
Date: 4 Aug 2007 15:22:49
Message: <46b4d209$1@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?


     Hi Lildog

     No, if your tutorial consists of multiple images, then just make sure 
that with each step, (each render), your model is located, (translated) to 
<0, 0, 0>. This will keep every step (model) of your tutorial in the centre 
of your canvas. For a short-cut to the problem, with the image that is going 
off the canvas, you could also rotate your camera keeping the same 
dimensions as the rest of your images.

     Looking forward to seeing the end result.  :o)


          ~Steve~




>
> lildog


Post a reply to this message

From: Charles C
Subject: Re: enlarging canvas but not image
Date: 4 Aug 2007 15:25:01
Message: <web.46b4ce1961f98363e33c01c00@news.povray.org>
T-n-T <lil### [at] donobinet> wrote:
> 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

Are these multiple-images applied to boxes with the camera pointed at an
arrangement of these boxes?  I have a feeling everything will get a lot
simpler if you use an orthographic camera.  Then you can scale either the
camera or the entire scene to make everything fit, and adjust the output by
the same proportion as the camera, or the inverse proportion of the scene.

OTOH, assuming the objects in the scene are more or less on a plane
perpendicular to the direction of the camera (I'm still imagining several
flat boxes with image maps on them), then even with a perspective camera,
you ought to be able to simply scale all the objects together to get things
to fit and not  have to think about changing the camera.  In your example,
you would just scale the union of all objects by 3/5, and then yes, set
your output res. to 500x500.

Charles


Post a reply to this message

From: Chris B
Subject: Re: enlarging canvas but not image
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

From: St 
Subject: Re: enlarging canvas but not image
Date: 4 Aug 2007 15:32:18
Message: <46b4d442$1@news.povray.org>
"Charles C" <nomail@nomail> wrote in message 
news:web.46b4ce1961f98363e33c01c00@news.povray.org...

> OTOH, assuming the objects in the scene are more or less on a plane
> perpendicular to the direction of the camera (I'm still imagining several
> flat boxes with image maps on them), then even with a perspective camera,
> you ought to be able to simply scale all the objects together to get 
> things
> to fit and not  have to think about changing the camera.

     Charles, I think Lildog is trying to keep some detail in the images 
also. If the image is scaled down, then it gets harder to see detail which 
is important with jewellery.


        ~Steve~





>
> Charles
>
>
>


Post a reply to this message

From: Charles C
Subject: Re: enlarging canvas but not image
Date: 4 Aug 2007 15:50:00
Message: <web.46b4d78361f98363e33c01c00@news.povray.org>
"St." <dot### [at] dotcom> wrote:
> "Charles C" <nomail@nomail> wrote in message
> news:web.46b4ce1961f98363e33c01c00@news.povray.org...
>
> > OTOH, assuming the objects in the scene are more or less on a plane
> > perpendicular to the direction of the camera (I'm still imagining several
> > flat boxes with image maps on them), then even with a perspective camera,
> > you ought to be able to simply scale all the objects together to get
> > things
> > to fit and not  have to think about changing the camera.
>
>      Charles, I think Lildog is trying to keep some detail in the images
> also. If the image is scaled down, then it gets harder to see detail which
> is important with jewellery.
>

If you scale the scene by 3/5 and while also increasing the output
resolution from 300x300 to 500x500 (see end of that paragraph), then each
object depicted in the image should take the same number of pixels as they
originally did, which is what I thought lildog was wanting.
Charles


Post a reply to this message

From: Charles C
Subject: Re: enlarging canvas but not image
Date: 4 Aug 2007 16:10:01
Message: <web.46b4dcab61f98363e33c01c00@news.povray.org>
"Charles C" <nomail@nomail> wrote:
> "St." <dot### [at] dotcom> wrote:
> > "Charles C" <nomail@nomail> wrote in message
> > news:web.46b4ce1961f98363e33c01c00@news.povray.org...
> >
> > > OTOH, assuming the objects in the scene are more or less on a plane
> > > perpendicular to the direction of the camera (I'm still imagining several
> > > flat boxes with image maps on them), then even with a perspective camera,
> > > you ought to be able to simply scale all the objects together to get
> > > things
> > > to fit and not  have to think about changing the camera.
> >
> >      Charles, I think Lildog is trying to keep some detail in the images
> > also. If the image is scaled down, then it gets harder to see detail which
> > is important with jewellery.
> >
>
> If you scale the scene by 3/5 and while also increasing the output
> resolution from 300x300 to 500x500 (see end of that paragraph), then each
> object depicted in the image should take the same number of pixels as they
> originally did, which is what I thought lildog was wanting.
> Charles


Hmm, upon re-reading the original post and others' replies, it looks like
most people are reading it as the piece of jewelry grew 3-dimensionally too
big to stay in view of the current camera, rather than using POV-Ray for 2D
composition of multiple images like I was guessing.  So... what I was
suggesting with a perspective camera would decrease the amount of
'perspective' for anything with much depth.
Charles


Post a reply to this message

From: Alain
Subject: Re: enlarging canvas but not image
Date: 4 Aug 2007 23:39:05
Message: <46b54659@news.povray.org>
T-n-T nous apporta ses lumieres en ce 2007/08/04 13:31:
> 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
It depends on exactly what you want to do.
Do you want a single image with multiple steps?
Does the scene tend to ocupy more space with each step?

In the first case, it would be better to render each step as a single image. 
Once each step is completed, you stitch them with some external application.

In the second case, you can, as others have mentioned, change the field of view 
of the camera.

You can also multiply the direction vector by the ratio Old_Width/New_Width. 
This will have the effect of zooming exactly acording to your change of area of 
interest.
A plus, is that you don't need to worry about trigonometric formulas (done 
internaly), and it's independent of the rendering resolution.
Just don't use the angle keyword. Used after adjusting the direction vector will 
reset it, and puting angle before can have strange results.

Another possibility would be to move the camera back.

-- 
Alain
-------------------------------------------------
Lutheran: If shit happens, don't talk about it.


Post a reply to this message

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