POV-Ray : Newsgroups : povray.general : Define camera angle from a given right : Re: Define camera angle from a given right Server Time
30 Jul 2024 10:15:00 EDT (-0400)
  Re: Define camera angle from a given right  
From: clipka
Date: 28 Feb 2009 07:15:00
Message: <web.49a92a8278557ac4e41007250@news.povray.org>
"gregjohn" <pte### [at] yahoocom> wrote:
> Now, regardless of what I do with the +H and +W switches, circles will be
> circular.   The problem is I may want to change the angle at some time. With
> the above code, I *can* change the horizontal field of view with:

If all you need to do is set proper values, then why mess with the
right/left/direction if you can have it simple?

    location   MyCameraPos
    direction  z
    up         y
    right      x*image_width/image_height
    look_at    MyWhateverImLookingAt
    angle      MyAngle

There. This will place MyWhateverImLookingAt right at the center of your image,
with any vertical line throuh that point being rendered as a vertical line in
the image, the angle between the center points on the left and right screen
edges being MyAngle, and the aspect ratio set to something proper.

The opening angle of MyAngle will result in objects' apparent size in pixels to
be

    Size*image_width/(Dist*2*tan(MyAngle/2))

where Size and Dist are the object's size and its distance from camera,
respectively.

I have no idea what the effects are of choosing different direction, up and/or
right vectors, but this one works reliably. No need to fuss around with any
friggin' 1.33.

Choose right -x*image_width/image_height if you're not happy with the
co-ordinate system handedness (I guess choosing direction -z would do the same
job but I didn't test).

Note that the order of statements may matter.


Post a reply to this message

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