POV-Ray : Newsgroups : povray.advanced-users : Spherical camera upside-down Server Time
29 Apr 2024 10:42:16 EDT (-0400)
  Spherical camera upside-down (Message 10 to 19 of 19)  
<<< Previous 9 Messages Goto Initial 10 Messages
From: clipka
Subject: Re: Spherical camera upside-down
Date: 8 Sep 2016 18:58:46
Message: <57d1ed26$1@news.povray.org>
Am 09.09.2016 um 00:00 schrieb Mike Horvath:

> The camera is spherical. Do I really need to scale the "up" and "right"
> vectors to the image dimensions? I was under the impression that the
> spherical camera already automatically fills a 2:1 aspect ratio image.

My bad, I didn't pay much attention to the camera type.

Having had a closer look at the source code, here's my updated
(counter-intuitive) advice:

- To mirror the image vertically, flip the _right_ vector.
- To mirror the image horizontally, flip the _up_ vector.
- To mirror the image vertically _and_ turn the camera 180 degrees, flip
the direction vector.

Entirely untested, but that's what I infer from the source code.


Post a reply to this message

From: Mike Horvath
Subject: Re: Spherical camera upside-down
Date: 8 Sep 2016 19:01:06
Message: <57d1edb2@news.povray.org>
On 9/8/2016 4:10 PM, clipka wrote:
> Am 08.09.2016 um 14:44 schrieb Mike Horvath:
>
>> 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?
>
> To me it looks like you're trying to achieve via camera up, right and
> direction what someone else has already cared for via the matrix
> transform, so effectively the two cancel out.
>

I forgot to add that the matrices are generated by the converter, and I 
have no influence over what they contain.


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: Spherical camera upside-down
Date: 8 Sep 2016 19:03:23
Message: <57d1ee3b$1@news.povray.org>
On 9/8/2016 6:58 PM, clipka wrote:
> Am 09.09.2016 um 00:00 schrieb Mike Horvath:
>
>> The camera is spherical. Do I really need to scale the "up" and "right"
>> vectors to the image dimensions? I was under the impression that the
>> spherical camera already automatically fills a 2:1 aspect ratio image.
>
> My bad, I didn't pay much attention to the camera type.
>
> Having had a closer look at the source code, here's my updated
> (counter-intuitive) advice:
>
> - To mirror the image vertically, flip the _right_ vector.
> - To mirror the image horizontally, flip the _up_ vector.
> - To mirror the image vertically _and_ turn the camera 180 degrees, flip
> the direction vector.
>
> Entirely untested, but that's what I infer from the source code.
>


I still suspect POV-Ray messes up when confronted with left-handed 
coordinate systems in the spherical camera code. My up, right, location 
and direction values work fine with a normal perspective camera. It's 
only when they are applied to a spherical camera that the results are 
incorrect.


Mike


Post a reply to this message

From: clipka
Subject: Re: Spherical camera upside-down
Date: 8 Sep 2016 19:40:48
Message: <57d1f700$1@news.povray.org>
Am 09.09.2016 um 01:03 schrieb Mike Horvath:
> On 9/8/2016 6:58 PM, clipka wrote:
>> Am 09.09.2016 um 00:00 schrieb Mike Horvath:
>>
>>> The camera is spherical. Do I really need to scale the "up" and "right"
>>> vectors to the image dimensions? I was under the impression that the
>>> spherical camera already automatically fills a 2:1 aspect ratio image.
>>
>> My bad, I didn't pay much attention to the camera type.
>>
>> Having had a closer look at the source code, here's my updated
>> (counter-intuitive) advice:
>>
>> - To mirror the image vertically, flip the _right_ vector.
>> - To mirror the image horizontally, flip the _up_ vector.
>> - To mirror the image vertically _and_ turn the camera 180 degrees, flip
>> the direction vector.
>>
>> Entirely untested, but that's what I infer from the source code.
> 
> I still suspect POV-Ray messes up when confronted with left-handed
> coordinate systems in the spherical camera code. My up, right, location
> and direction values work fine with a normal perspective camera. It's
> only when they are applied to a spherical camera that the results are
> incorrect.

No, POV-Ray doesn't mess up in spherical camera mode. It just uses the
`right` and `up` vectors in a weird, non-intuitive manner. As alluded in
my updated advice, `right` doesn't specify what's left and right in a
spherical camera image, nor does `up` specify what's up and down.

Instead, `direction` and `right` together specify what's up and down
(the `direction` vector rotated around the `right` vector by 90 degrees
gives you up when rotated in one particular direction, and down when
rotated in the other), and `direction` and `up` together specify what's
left and right (again the `direction` vector rotated around the `up`
vector by 90 degrees gives you left when roated in one particular
direction, and right when rotated in the other).


Post a reply to this message

From: Mike Horvath
Subject: Re: Spherical camera upside-down
Date: 8 Sep 2016 20:24:52
Message: <57d20154$1@news.povray.org>
On 9/8/2016 6:58 PM, clipka wrote:
> My bad, I didn't pay much attention to the camera type.
>
> Having had a closer look at the source code, here's my updated
> (counter-intuitive) advice:
>
> - To mirror the image vertically, flip the _right_ vector.
> - To mirror the image horizontally, flip the _up_ vector.
> - To mirror the image vertically _and_ turn the camera 180 degrees, flip
> the direction vector.
>
> Entirely untested, but that's what I infer from the source code.
>

Do you mean mirroring or rotating? Because the image needs to be rotated 
180 degrees, not mirrored.


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: Spherical camera upside-down
Date: 8 Sep 2016 20:50:52
Message: <57d2076c$1@news.povray.org>
On 9/8/2016 8:24 PM, Mike Horvath wrote:
> On 9/8/2016 6:58 PM, clipka wrote:
>> My bad, I didn't pay much attention to the camera type.
>>
>> Having had a closer look at the source code, here's my updated
>> (counter-intuitive) advice:
>>
>> - To mirror the image vertically, flip the _right_ vector.
>> - To mirror the image horizontally, flip the _up_ vector.
>> - To mirror the image vertically _and_ turn the camera 180 degrees, flip
>> the direction vector.
>>
>> Entirely untested, but that's what I infer from the source code.
>>
>
> Do you mean mirroring or rotating? Because the image needs to be rotated
> 180 degrees, not mirrored.
>
>
> Mike

Disregard.


Mike


Post a reply to this message

From: Le Forgeron
Subject: Re: Spherical camera upside-down
Date: 9 Sep 2016 12:30:08
Message: <57d2e390@news.povray.org>
Le 08/09/2016 à 14: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

If you add a small look_at, it goes fine.

What is interesting is without it it seems to not recompute the direction/up/right


Post a reply to this message


Attachments:
Download 'ca.png' (3 KB) Download 'ca.pov.txt' (2 KB)

Preview of image 'ca.png'
ca.png

From: Thorsten Froehlich
Subject: Re: Spherical camera upside-down
Date: 9 Sep 2016 12:55:00
Message: <web.57d2e8d4978968acdadd19850@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
> Le 08/09/2016 à 14:44, Mike Horvath a écrit :
>
> If you add a small look_at, it goes fine.
>
> What is interesting is without it it seems to not recompute the direction/up/right

I think this is intentional, as we had to define an order for camera parameters
in 3.6 to overcome a lot of trouble with the arbitrary order of parameters
taking immediate effect. Thus the relative parameters are only applied once in a
specific order and cannot be transformed in a meaningful way (the internal
representation is slightly different from the misc options available to the
user). Only absolute positions will be affected by teh transformation for
obvious reasons then: It is impossible to know what part of a transformation to
apply on which relative parameter (i.e. translations would not make sense).


Post a reply to this message

From: Bald Eagle
Subject: Re: Spherical camera upside-down
Date: 10 Sep 2016 08:45:00
Message: <web.57d3fff9978968ac5e7df57c0@news.povray.org>
http://www.the5thwave.com/cartoon/3906


Post a reply to this message

From: Doctor John
Subject: Re: Spherical camera upside-down
Date: 10 Sep 2016 16:31:04
Message: <57d46d88@news.povray.org>
On 10/09/16 13:43, Bald Eagle wrote:
> http://www.the5thwave.com/cartoon/3906
> 
> 

Heh! I'd almost forgotten Rich Tennant's cartoons. Thanks for the reminder.

John
-- 
It's not about bravery.
It's about doing what I need to do to win


Post a reply to this message

<<< Previous 9 Messages Goto Initial 10 Messages

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