POV-Ray : Newsgroups : povray.binaries.images : Question about camera's right vector : Re: Question about camera's right vector Server Time
18 Apr 2024 02:58:35 EDT (-0400)
  Re: Question about camera's right vector  
From: BayashiPascal
Date: 13 Dec 2020 04:00:01
Message: <web.5fd5d7c4c652136e2ce8b2430@news.povray.org>
Thanks a million Thomas!

Specifying the 'direction' vector as you suggested solved my problem. I was
thinking it's automatically calculated based on the 'location' and 'look_at'
vectors.

Thanks again :-)

(in case you wonder what I'm doing with such non standard settings: I'm working
on a project where the Pov-Ray script is automatically generated by another
program which calculates, among other things, the camera's attitude)

Regards,
Pascal


Thomas de Groot <tho### [at] degrootorg> wrote:
> Op 13/12/2020 om 08:26 schreef BayashiPascal:
> > Hi everyone,
> > Could someone help me understand what's happening in the image attached please ?
> > I have a camera on the +x axis looking at the origin and a box rotating around
> > the x axis.
> > With the default camera (WithRight=0), I obtain what I'm expecting. The +z axis
> > is toward the right of the image and the box rotates clockwise.
> > Now if I specify explicitly the right vector of the camera to be like in the
> > first image toward the +z axis  (WithRight=1), the +z axis is now toward the
> > left of the image, and the box rotates counter clocwise, but +x still points
> > toward the camera. I would expect to have the same image as (WithRight=0).
> > Also, if I set the right vector to -z (WithRight=2), I obtain the same image as
> > with +z, which is puzzling me, as I would expect it to invert the handedness of
> > the axes.
> >
> > Reading the documentation:
> > http://wiki.povray.org/content/Reference:Camera#Up_and_Right_Vectors
> > doesn't help me understanding what I'm getting wrong. Could someone help me ?
> >
> > I paste the code below if you want to try it.
> >
> > #version 3.7;
> >
> > background { color rgb 1.0 }
> >
> > #declare WithRight=0;
> >
> > #declare cameraPos = 3.0 * x;
> > #declare cameraLookAt = 0;
> > camera {
> >    location cameraPos
> >    look_at cameraLookAt
> > #if (WithRight = 1)
> >    right z * 1.5
> > #end
> > #if (WithRight = 2)
> >    right -z * 1.5
> > #end
> > }
> >
> > light_source {
> >    100.0
> >    color rgb 1
> > }
> >
> > #declare Target = box {
> >    <-0.5,-0.5,-0.5>
> >    <0.5,1,0.5>
> >    texture {
> >      pigment {
> >        color rgb 0.5
> >      }
> >    }
> > }
> >
> > object {
> >    Target
> >    rotate x
> >    translate -z
> > }
> > object {
> >    Target
> >    rotate x * 10.0
> > }
> > object {
> >    Target
> >    rotate x * 20.0
> >    translate +z
> > }
> >
> > union {
> >    cylinder { 0, x, 0.01 texture {pigment {color x}}}
> >    cylinder { 0, y, 0.01 texture {pigment {color y}}}
> >    cylinder { 0, z, 0.01 texture {pigment {color z}}}
> >    translate x
> >    no_shadow
> > }
> >
>
> It seems that you have not explicitly added a 'direction' vector. By
> default, it is <0,0,1> where the camera location is pointing along the
> z-axis by default. However, as your camera is pointing towards -x, the
> default direction may have put you in trouble. Try: direction <-1,0,0>
>
> When using non-standard camera settings, do not rely (too much) on the
> default values!
>
> --
> Thomas


Post a reply to this message

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