|
![](/i/fill.gif) |
"gregjohn" <pte### [at] yahoo com> 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
|
![](/i/fill.gif) |