POV-Ray : Newsgroups : povray.binaries.images : Question about camera's right vector : Question about camera's right vector Server Time
18 Apr 2024 23:29:55 EDT (-0400)
  Question about camera's right vector  
From: BayashiPascal
Date: 13 Dec 2020 02:30:00
Message: <web.5fd5c20ee1ddd2e62ce8b2430@news.povray.org>
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
}


Post a reply to this message


Attachments:
Download 'axisrot.jpg' (103 KB)

Preview of image 'axisrot.jpg'
axisrot.jpg


 

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