POV-Ray : Newsgroups : povray.advanced-users : Spherical camera upside-down : Re: Spherical camera upside-down Server Time
29 Apr 2024 12:20:34 EDT (-0400)
  Re: Spherical camera upside-down  
From: clipka
Date: 8 Sep 2016 16:10:28
Message: <57d1c5b4$1@news.povray.org>
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.

My recommendation would be to try and start from scratch:

- The `sky` vector should be set to whatever is really "up" in the
scene; the default is `y`, but you most certainly want `-y`.

- The `up` vector should also be set to whatever is really "up" in the
scene, possibly multiplied by `image_height/image_width`(*).

- The `right` vector should be set to whatever is "right" according to
the orientation you find the scene easiest to visualize, possibly
multiplied by `image_width/image_height`(*). You might pick `+x`.

- The `direction` vector should be set to whatever is "forward"
according to your choice of "right", possibly multiplied by a zoom
factor. (Alternatively, you can keep the `direction` vector constant and
apply a factor to both `up` and `right` for zooming.

- The `location` should, for now, be a place from where, given the above
settings, you should be able to see something in the scene.

(*only one of `up` or `right` should be multiplied with the stated
factor; note that one is the inverse of the other)


Once you get something remotely useful out of this straightforward
camera setup, you can proceed to tweak the perspective to your liking in
one of the following manners:

(A) The Hard Way: Mess with the `up`, `right` and `direction` vectors
manually. It is up to you to make sure they stay orthogonal and at the
proper relative lengths, and since that can be quite a pain and prone to
errors I really wouldn't recommend this.

If you choose this approach, I think you should theoretically be able to
get away without a `sky` vector.

(B) Transformation: Simply add rotations and translations to the camera
statements. Be aware that rotations are always around the origin, so
unless your camera is at <0,0,0> rotations will not only change the
viewing direction, but also the location of the camera. (Theoretically
you can also use scaling and matrix transformations, but I would would
advise against this, as both may cause you to accidently flip the
coordinate system if you don't pay attention.)

If you choose this approach, I think you should also theoretically be
able to get away without a `sky` vector.

(C) Look At: Specify a `look_at` point; the camera will automatically be
re-oriented (but remain at the same place) to point at the specified
location. This is my preferred approach.

If you choose this approach, a `sky` vector is mandatory. POV-Ray will
re-orient the camera in such a manner that the effective `up` vector
will remain as close as possible to the `sky` vector


In all three variants, you can zoom by either messing with the length of
the direction vector in relation to that of the up/right vectors, or by
simply specifying an `angle` parameter.


Post a reply to this message

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