POV-Ray : Newsgroups : povray.general : Need help understanding Camera, direction Server Time
3 Aug 2024 14:19:59 EDT (-0400)
  Need help understanding Camera, direction (Message 1 to 3 of 3)  
From: StephenS
Subject: Need help understanding Camera, direction
Date: 23 Feb 2004 06:32:08
Message: <4039e4b8@news.povray.org>
The following code renders as expected. Perspective and spherical camera
look to the right (direction <.25,0,1>) and the box appears to the left of
center.

light_source {
  <1,19,-14>
  color rgb <1,1,1>
}
box {-1,1
  pigment{rgb<0,1,0>}
  scale 0.2
  translate <0,0,3>
}

camera {
  spherical
    angle 40 80
  location  <0,0,0>
  direction <0,0,1>
//  direction <.25,0,1>
  up        <0,1,0>
  right     <4/3,0,0>
  sky       <0,1,0>
}
/*
camera {
  perspective
  location  <0,0,0>
  direction <0,0,1>
//  direction <.25,0,1>
  up        <0,1,0>
  right     <4/3,0,0>
  sky       <0,1,0>
}
*/

The following example confuses me. I have switched the y and z co-ordinates
but not mirrored x. The spherical camera look to the left (+x goes to the
left) and the box appears to the right of center. The perspective camera
however seems to look to the right (why?) and the box appears to the left of
center. I would expect to have both the perspective and spherical cameras to
behave the same. How am I misinterpreting the direction vector?

light_source {
  <1,-14,19>
  color rgb <1,1,1>
}
box {-1,1
  pigment{rgb<0,1,0>}
  scale 0.2
  translate  <0,3,0>
}

camera {
  spherical
    angle 40 80
  location  <0,0,0>
  direction <0,1,0>
//  direction <.25,1,0>
  up        <0,0,1>
  right     <4/3,0,0>
  sky       <0,0,1>
}
/*
camera {
  perspective
  location  <0,0,0>
  direction <0,1,0>
//  direction <.25,1,0> // not expected
  up        <0,0,1>
  right     <4/3,0,0>
  sky       <0,0,1>
}
*/


Post a reply to this message

From: Hughes, B 
Subject: Re: Need help understanding Camera, direction
Date: 23 Feb 2004 22:01:11
Message: <403abe77$1@news.povray.org>
"StephenS" <ssh### [at] ottawanet> wrote in message
news:4039e4b8@news.povray.org...
>
> The following example confuses me. I have switched the y and z
co-ordinates
> but not mirrored x. The spherical camera look to the left (+x goes to the
> left) and the box appears to the right of center. The perspective camera
> however seems to look to the right (why?) and the box appears to the left
of
> center. I would expect to have both the perspective and spherical cameras
to
> behave the same. How am I misinterpreting the direction vector?
>
> camera {
>   perspective
>   location  <0,0,0>
>   direction <0,1,0>
> //  direction <.25,1,0> // not expected
>   up        <0,0,1>
>   right     <4/3,0,0>
>   sky       <0,0,1>
> }

Um, because 'right' is still designated as a positive x direction? Even
though the rest would make +x be on the left I guess that's inverting the x
axis. I'm not 100% sure about it.

Anyway, is there some reason you can't use 'look_at' and 'angle' instead of
'direction'? I'm guessing, you did it this way to try and echo the
parameters of the two types of cameras since angle gets used differently, so
only way was this?

Bob H.


Post a reply to this message

From: StephenS
Subject: Re: Need help understanding Camera, direction
Date: 23 Feb 2004 22:20:53
Message: <403ac315$1@news.povray.org>
...
> Anyway, is there some reason you can't use 'look_at' and 'angle' instead
of
> 'direction'? I'm guessing, you did it this way to try and echo the
> parameters of the two types of cameras since angle gets used differently,
so
> only way was this?
>
> Bob H.
I'm using direction (and up, right) so I can intentionally distort the
viewing plane (shear). I happened to notice a different output than what I
was expecting when playing with different numbers :-)

Stephen


Post a reply to this message

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