POV-Ray : Newsgroups : povray.newusers : Orthographic camera problems Server Time
4 Nov 2024 17:30:44 EST (-0500)
  Orthographic camera problems (Message 1 to 3 of 3)  
From: Drax7
Subject: Orthographic camera problems
Date: 3 Jan 2005 07:25:01
Message: <web.41d9398029446c6b872cdb970@news.povray.org>
I'm seeing very strange behavior from the orthographic camera, where
sometimes the whole image seems to disappear from the camera. I worked up a
simple script to demonstrate the problem that creates four spheres at a
Z-coordinate of 1. (This script works as I expect, the problem comes
later):

camera {
    orthographic
    #declare WINDOW=2;
    right WINDOW*4/3*x
    up WINDOW*y
    translate <0.5, 0.5, 0>
}

#macro RefBall(loc)
sphere {
    loc 0.2
    pigment {rgb loc}
    finish {ambient 1}
}
#end

RefBall(<0,0,1>)
RefBall(<0,1,1>)
RefBall(<1,0,1>)
RefBall(<1,1,1>)

As I expect, I see four circles. Now if I change the camera to say:
    translate <0.5, 0.5, 0.5>
I would expect to see these same four spheres. But instead I see nothing.

What's really strange is that if I translate the camera to anything up from
<0.5, 0.5, -10000> to <0.5, 0.5, 0.2> then I *do* see the four spheres with
a Z-coordinate of 1. But as soon as I hit <0.5, 0.5, 0.2001> everything
disappears. Strangely, the point where everything disappears matches the
diameter of the sphere - if I make the diameter of the sphere 0.3, then I
can move the camera to <0.5, 0.5, 0.3> before everything disappears.

Is this a bug, or do I have some fundamental misunderstanding of how the
orthographic camera works?


Post a reply to this message

From: Tom Melly
Subject: Re: Orthographic camera problems
Date: 3 Jan 2005 15:32:39
Message: <41d9abe7@news.povray.org>
"Drax7" <nomail@nomail> wrote in message
news:web.41d9398029446c6b872cdb970@news.povray.org...
>
> Is this a bug, or do I have some fundamental misunderstanding of how the
> orthographic camera works?

That latter I suspect. Re-read "3.3.1.2.2  Orthographic projection" and see
if at least verifies that the orthographic camera is very confusing, even if
it doesn't help you understand it (I never have).

That said, specifying a "look_at" point might help....


Post a reply to this message

From: Drax7
Subject: Re: Orthographic camera problems
Date: 4 Jan 2005 18:40:00
Message: <web.41db292cda48791d47d614ce0@news.povray.org>
"Tom Melly" <pov### [at] tomandlucouk> wrote:
> That latter I suspect. Re-read "3.3.1.2.2  Orthographic projection" and see
> if at least verifies that the orthographic camera is very confusing, even if
> it doesn't help you understand it (I never have).

I read it several times before posting. :-)

Actually, after sleeping on it for a while I figured out what the problem
wsa.

> That said, specifying a "look_at" point might help....

You're right. The problem was that because I was translating the camera, the
look_at point was always <0,0,1> away from the camera position. Since the
camera effectively creates its "window" at the look_at point, this means
that once I moved more than a certain distance, the spheres were behind the
"window."

In short, with a perspective camera, you can see anything in front of the
camera. With an orthographic camera, you can only see things beyond the
look_at point. Except that you seem to be able to see a whole object if any
part of it is beyond the look_at point. (That's why I had the camera so
close in the first place - part of a height_map was obscuring the shot I
wanted.)

Since the distance between the camera location and the look_at point makes
no difference to the view you get with an orthographic camera, the trick is
just to move the look_at point really close to the camera to make sure that
everything is past it.

Thanks for the reply!


Post a reply to this message

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