POV-Ray : Newsgroups : povray.general : coordinate system? : Re: coordinate system? Server Time
29 Jul 2024 06:28:59 EDT (-0400)
  Re: coordinate system?  
From: Le Forgeron
Date: 4 Sep 2012 07:19:37
Message: <5045e3c9$1@news.povray.org>
Le 04/09/2012 10:38, bugbear a écrit :
> camera {
>  location <100, 100, -120>   // Where the Camera is located <x,y,z>
>  look_at <0, 0, 0>    // Where is the camera is looking <x,y,z>
>  direction <0, 400/25.4, 0> // 400mm lens
> }

I'm afraid, by the comments, that you are in for some delusions (where
did you get that /25.4 ? there is no unit in povray (excepted now for
SSLT), so no inches/mm !).

You did not specify the right vector, yet you expect the ratio between
direction & right to set the viewing angle. (and the default for right
is +1.33*x )

x.y = z ... right . up = direction
z.x = y ... direction.right = up
y.z = x ... up.direction = right

You fixed direction as +y, which trigger a small part of the code
because up (undefined, default to +y), and right(undefined, default to
+1.33*x) must now be recomputed by look_at.

The handedness is first computed between direction, up & right.
 handedness = (Up cross Direction) dot Right

As you did not change the sky, it use the default +y, the cross product
of sky by normalised(look_at - location) provide the new right.

sky is +y, look_at - location is -100*x-100*y+120*z...

then Up is recomputed from cross of (look_at - location) by fresh right
and finally the handedness is restored with the length of right:

 if handedness > 0, right is scaled by a positive number
 else, by a negative number.

(Up is also restored to its length, but that's not a problem)

Your heresy: *handedness is 0* ( +y cross +y is null vector. )

How to fix it ?
===============
Define a Up vector too (and not parallel to Direction, nor right)


Post a reply to this message

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