POV-Ray : Newsgroups : povray.advanced-users : Spherical camera upside-down : Re: Spherical camera upside-down Server Time
29 Apr 2024 07:17:42 EDT (-0400)
  Re: Spherical camera upside-down  
From: Alain
Date: 8 Sep 2016 17:44:52
Message: <57d1dbd4$1@news.povray.org>
Le 16-09-08 à 08:44, Mike Horvath a écrit :
> I have the following spherical camera:
>
>         #declare Camera_Up        = -y;
>         #declare Camera_Right        = +z;
>         #declare Camera_Location    = <0,0,0>;
>         #declare Camera_Direction    = -x;
>         #declare Camera_LookAt        = Camera_Location + Camera_Direction;
>         #declare Camera_Transform = transform
>         {
>             matrix <0,0,-1,0,1,0,1,0,0,0,-88,-640>        // front entrance
>         //    matrix <0,0,-1,0,1,0,1,0,0,0,-88,100>
>         //    matrix <0,0,-1,0,1,0,1,0,0,0,-88,-180>
>         //    matrix <0,0,-1,0,1,0,1,0,0,-280,-88,-180>
>         //    matrix <0,0,-1,0,1,0,1,0,0,280,-312,140>
>         //    matrix <0,0,-1,0,1,0,1,0,0,200,-312,-140>
>         //    matrix <0,0,-1,0,1,0,1,0,0,-200,-312,-140>
>         //    matrix <0,0,-1,0,1,0,1,0,0,-360,-312,140>
>         }
>         camera
>         {
>             spherical
>             angle        360 180
>             up        Camera_Up
>             right        Camera_Right
>             location    Camera_Location
>             direction    Camera_Direction
>             transform {Camera_Transform}
>         }
>
> It is a LDraw model, which has an inverted y axis or handedness. The
> problem is when I render the scene, it appears upside-down. Even though
> I already compensated by making the y axis negative. Anyone have an idea
> what is going on?
>
> Mike

I'd start with a default like camera located at the origin and looking 
toward +z.
Next, I would translate it to the desired location then orient it using 
look_at.

camera{
  spherical
  location <0,0,0> // from here
  up y sky y
  right 4/3*x
  direction z // to here we replicate the default camera parameters
  translate Camera_Location
  look_at Interest_Point
  angle View_Angle
}

If the image is upside down, you can :
negate the up and sky vector. You may also need to negate the right 
vector in this case.
rotate the camera 180° around the z axis before translating it.



Alain


Post a reply to this message

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