POV-Ray : Newsgroups : povray.general : Negative Camera Direction Server Time
2 Nov 2024 07:25:09 EDT (-0400)
  Negative Camera Direction (Message 1 to 7 of 7)  
From: Eamon Caddigan
Subject: Negative Camera Direction
Date: 29 Mar 2004 13:27:49
Message: <40686aa5$1@news.povray.org>
In scenes rendered with a negative camera direction, the scene appears
flipped about the y-axis. Using the pinhole camera model, however, it
would seem that the image should be flipped about both the x- and
y-axes. Am I missing something important?

-Eamon


Post a reply to this message

From: Chambers
Subject: Re: Negative Camera Direction
Date: 29 Mar 2004 20:09:05
Message: <4068c8b1@news.povray.org>
"Eamon Caddigan" <eca### [at] uiucedu> wrote in message
news:40686aa5$1@news.povray.org...
> In scenes rendered with a negative camera direction, the scene appears
> flipped about the y-axis. Using the pinhole camera model, however, it
> would seem that the image should be flipped about both the x- and
> y-axes. Am I missing something important?
>
> -Eamon

How did you give the camera a "negative" direction?  The answer will
determine how to flip the axis.

That being said, try putting "up -y" in the camera statement.

-- 
...Chambers
http://www.geocities.com/bdchambers79


Post a reply to this message

From: Eamon Caddigan
Subject: Re: Negative Camera Direction
Date: 30 Mar 2004 14:56:43
Message: <slrnc6jk7q.9k3.ecaddiga@rafah.ks.uiuc.edu>
Chambers <bdc### [at] yahoocom> wrote:
> "Eamon Caddigan" <eca### [at] uiucedu> wrote in message
> news:40686aa5$1@news.povray.org...
>> In scenes rendered with a negative camera direction, the scene appears
>> flipped about the y-axis. Using the pinhole camera model, however, it
>> would seem that the image should be flipped about both the x- and
>> y-axes. Am I missing something important?
>>
>> -Eamon
> 
> How did you give the camera a "negative" direction?  The answer will
> determine how to flip the axis.

One scene has the following camera definition:
camera { 
  location <0.0000, 0.0000, -2.0000>
  look_at <0.0000, 0.0000, -0.0000>
  up <0.0000, 6.0000, 0.0000>
  right <8.0000, 0.0000, 0.0000>
  direction <-0.0000, -0.0000, -4.0000> 
}

If the direction vector begins at the location point, it's pointing
"away" from the look_at point. Maybe the problem is my comprehension of
POV-Ray's camera model.

> That being said, try putting "up -y" in the camera statement.

Changing up vector in the example above to <0.0000, -6.0000, 0.0000>
simply flips the image about the y-axis again, resulting in the same
image obtained using a positive camera direction. I also tried flipping
the right vector, and both vectors, but nothing gave the results I was
expecting. I even tried adding a sky vector and rearranging the order of
the camera options, but that didn't do anything either.

I'll be the first to admit that placing the image plane /behind/ the
view point is an odd thing to do, and I'm willing to accept that POV-Ray
just won't behave exactly like a pinhole camera (mirroring the image
about both axes) in this case. I just wanted to make sure that I wasn't
missing anything before I gave up.

Thanks for the reply,
Eamon


Post a reply to this message

From: Chambers
Subject: Re: Negative Camera Direction
Date: 30 Mar 2004 16:56:15
Message: <4069ecff$1@news.povray.org>
"Eamon Caddigan" <eca### [at] uiucedu> wrote in message
news:slr### [at] rafahksuiucedu...
> Chambers <bdc### [at] yahoocom> wrote:
> > "Eamon Caddigan" <eca### [at] uiucedu> wrote in message
> > news:40686aa5$1@news.povray.org...
> >> In scenes rendered with a negative camera direction, the scene appears
> >> flipped about the y-axis. Using the pinhole camera model, however, it
> >> would seem that the image should be flipped about both the x- and
> >> y-axes. Am I missing something important?
> >>
> >> -Eamon
> >
> > How did you give the camera a "negative" direction?  The answer will
> > determine how to flip the axis.
>
> One scene has the following camera definition:
> camera {
>   location <0.0000, 0.0000, -2.0000>
>   look_at <0.0000, 0.0000, -0.0000>
>   up <0.0000, 6.0000, 0.0000>
>   right <8.0000, 0.0000, 0.0000>
>   direction <-0.0000, -0.0000, -4.0000>
> }

If you use look_at, you don't need to use direction.  So your camera
statement could be
camera {
 up y*8
 right x*8
 location -z*2
 look_at 0
}

<goes off to fiddle>

-- 
...Chambers
http://www.geocities.com/bdchambers79


Post a reply to this message

From: Fredrik Eriksson
Subject: Re: Negative Camera Direction
Date: 30 Mar 2004 17:12:32
Message: <opr5o35sd6zjc5hb@news.povray.org>
On 30 Mar 2004 14:56:43 -0500, Eamon Caddigan <eca### [at] uiucedu> wrote:
> One scene has the following camera definition:
> camera {
>   location <0.0000, 0.0000, -2.0000>
>   look_at <0.0000, 0.0000, -0.0000>
>   up <0.0000, 6.0000, 0.0000>
>   right <8.0000, 0.0000, 0.0000>
>   direction <-0.0000, -0.0000, -4.0000>
> }
>
> If the direction vector begins at the location point, it's pointing
> "away" from the look_at point. Maybe the problem is my comprehension of
> POV-Ray's camera model.

With POV-Ray's camera model, there is no way to look "away" from the 
look_at point.
'look_at' (if specified) is always applied after 'direction'. That makes 
your camera statement equivalent to:

camera {
   location <0, 0, -2>
   up <0, 6, 0>
   right <8, 0, 0>
   direction <0, 0, -4>
   look_at <0, 0, 0>
}

...which, in turn, is equivalent to:

camera {
   location <0, 0, -2>
   up <0, 6, 0>
   right <8, 0, 0>
   direction vnormalize(<0,0,0> - <0,0,-2>)*4
}

or

camera {
   location <0, 0, -2>
   up <0, 6, 0>
   right <8, 0, 0>
   direction <2, 3, sqrt(2)>	// Arbitrary vector with length 4
   look_at <0, 0, 0>
}


When you specify all three of 'up', 'right' & 'look_at', the actual 
direction of 'direction' no longer matters. Only its length matters, since 
that determines the field of view (unless you also specify 'angle').

You might want to take a closer look at section 6.4.1 of the docs, 
especially 6.4.1.4.


---
FE (on topic this time)


Post a reply to this message

From: Chambers
Subject: Re: Negative Camera Direction
Date: 30 Mar 2004 17:34:37
Message: <4069f5fd$1@news.povray.org>
OK, using the following scene:

camera {
   up y
   right x
   location -z*1
   look_at 0
}

box {<.1,.1,0>,<1,1,9> pigment {color red 1}}
box {<-.1,.1,0>,<-1,1,9> pigment {color green 1}}
box {<.1,-.1,0>,<1,-1,9> pigment {color blue 1}}
box {<-.1,-.1,0>,<-1,-1,9> pigment {color rgb 1}}

light_source {<0,0,-5> color rgb 1}

I see four boxes in the following configuration:
G R
W B

Using "up -y" gives
R G
B W

Using "up y" and "right -x"
R G
B W

And "up -y" with "right -x"
G R
W B

So it seems both of them flip the image in the horizontal direction.

Using up y, right x, and introducing "sky -y" gives
B W
R G

Which is what you're looking for.  BTW, there is nothing "odd" about placing
the objects "behind" the camera; everything about the orientation is
arbitrary, anyway :)

Oh, and 6.4.1 in the docs gives some great info on how the camera works.

-- 
...Chambers
http://www.geocities.com/bdchambers79


Post a reply to this message

From: Eamon Caddigan
Subject: Re: Negative Camera Direction
Date: 31 Mar 2004 12:57:59
Message: <slrnc6m1l7.cup.ecaddiga@rafah.ks.uiuc.edu>
Chambers <bdc### [at] yahoocom> wrote:
> 
> Using up y, right x, and introducing "sky -y" gives
> B W
> R G
> 
> Which is what you're looking for.  BTW, there is nothing "odd" about placing
> the objects "behind" the camera; everything about the orientation is
> arbitrary, anyway :)

Ah, I didn't try using sky w/out the "negative" direction. Thanks!

> Oh, and 6.4.1 in the docs gives some great info on how the camera works.

I was just trying to reconcile the details of POV-Ray's camera model
with how I'm used to setting up cameras in OpenGL. I think I've got it
all down now. Thanks again everybody!

-Eamon


Post a reply to this message

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