POV-Ray : Newsgroups : povray.advanced-users : Zooming orthographic camera : Re: Zooming orthographic camera Server Time
25 Apr 2024 18:09:28 EDT (-0400)
  Re: Zooming orthographic camera  
From: Leroy
Date: 6 Dec 2016 15:10:01
Message: <web.584719f97c1309eec6bb200e0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> I'd like to know the best way to calculate the amount of zoom the orthographic
> camera needs when changing render size from smaller to larger.
>
> I typically define a Zoom variable and then divide up and right by that to zoom
> in.
> I can "ball park" it, but I never seem to be able to make a calculation that
> gets me exact results.
>
> Has anyone been able to manipulate the orthographic view accurately and
> reliably, and can offer a suggestion or solution?
>
> Thanks!   :)

What are trying to do?
I've been playing with the orthographic camera to make images for Quake2.
I wanted the scene to match different render sizes.
I use
camera{  orthographic
        location <0,0,-10>
        look_at <0,0,0>
        right x*10
        up y*10
        }

I use image_width & image_height to calculate where things should go.
With image_width & image_height are the same the render image is just bigger or
small.
If they are different then one direction will always be limit by 5. That is when
looking from the -z direction a object place in the  x or y (depends on size)
will be on the border of a rendered image.

I just thought of something I need to try.(it didn't work)
But maybe this is what you need(haven't tried it).
if image_width > image_height  right x*10*image_width / image_height
if image_width < image_height  up x*10*image_height  / image_width

Hope this helps!
Have fun!


Post a reply to this message

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