POV-Ray : Newsgroups : povray.newusers : Displacing camera in 2D? : Re: Displacing camera in 2D? Server Time
28 Jul 2024 20:24:12 EDT (-0400)
  Re: Displacing camera in 2D?  
From: remigagne
Date: 25 Sep 2007 20:35:00
Message: <web.46f9a81847bea764899005320@news.povray.org>
Sorry for the delayed response, but I just got everything working.  Thanks
so much for all your feedback!

The hint that hit it home was the simple observation that everything is
easier with a camera parallel to axis.  So, instead of positioning my
camera to get the right view angle, I left it looking straight down the Z
axis, then rotated the entire scene itself.  Seems strange, but it worked
like a charm!

Also, if the image is 100x100 and orthographic camera up=100*y and
right=100*x, translating the camera that looks down z by one unit in either
x or y gives exactly a one pixel difference in output.  Wonderful!

Thanks again for all the help.


Remi

Alain <ele### [at] netscapenet> wrote:
> It would be easier if your camera was parallel to an axis, like the z axis.
> You first need to evaluate how many pov-units fit in your 1000 original pixels.
> It can be evaluated empiricaly using a plane with a checker pattern. It can be
> calculated from the direction vector that default to 1. It's about the same as
> the distance between the location and the look_at point, or about 42169
> pov-units whide! The field of view extend 0.5 units left and right from the
> camera axis at 1 unit in front of the camera, multiplied by the distance to the
> look_at point.
> So, for each 1 pixel of movement, you need to move the camera 42.17 units. You
> could use the vrotate(<Udx,Udy,0>, Your_Angle) macro on the <Udx, Udy, 0> vector
> of the user to get the <dx,dy,dz> translate vector you need.
> You can add translate<dx,dy,dz> to your camera after everything else. This way,
> your camera won't change it's orientation: the location and look_at will change
> in exactly the same direction and distance. Easier to maintain and less chance
> of making a typo.
>
> --
> Alain
> -------------------------------------------------
> You know you've been raytracing too long when you have ever "Hand-Coded" a
> bezier patch.
> Stephan Ahonen


Post a reply to this message

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