POV-Ray : Newsgroups : povray.advanced-users : Zooming orthographic camera : Re: Zooming orthographic camera Server Time
19 Apr 2024 13:08:43 EDT (-0400)
  Re: Zooming orthographic camera  
From: Alain
Date: 6 Dec 2016 19:55:38
Message: <58475e0a$1@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!
>
>

With your camera defined as in the sample, you see a 10 units by 10 
units area.
If you want to double the image size while keeping the same dimention 
for the elements of the image, you need to also double the up and right 
vectors. So, that become : right x*20 up y*20

If you want to make it automatic, then you need to link those values to 
image_width and image_height.

right x*image_width/Size_Adjustment
up y*image_height/Size_Adjustment


one POV unit in the scene. A value of 10 mean that 10 pixels will be 
needed to represent each unit.


Alain


Post a reply to this message

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