|
|
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
|
|
|
|
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'
|
|