POV-Ray : Newsgroups : povray.binaries.images : Question about camera's right vector : Re: Question about camera's right vector Server Time
20 Apr 2024 01:01:49 EDT (-0400)
  Re: Question about camera's right vector  
From: Thomas de Groot
Date: 13 Dec 2020 02:48:15
Message: <5fd5c73f$1@news.povray.org>
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.