![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Sascha Ledinsky
Subject: Re: Parse Warning: Camera vectors are not perpendicular.
Date: 9 Mar 2005 04:03:35
Message: <422ebbe7$1@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Thank you!
To be honest, I did not know how to quickly check if the matrix is
correct, and since the resulting images looked right... :-/
I have found the problem: The quaternion used to compute the matrix uses
single precision floats. The fix was to first create a double-precision
quaternion from it, then re-normalize that and feed the double-precision
quaternion into the matrix...
Thanks again!
But still, isn't the test POV performs too strict?
I understand that POV-Ray must use double precision math for most
operations, but would, in this case, the single-precision matrix really
break the vista buffer?
This will enforce all external applications that are used to create
POV-scenes to use double-precision math throughout, and I don't know if
it is available in all (script) languages...
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <422eb8bb$1@news.povray.org>,
Sascha Ledinsky <sas### [at] users sourceforge net> wrote:
> That should work, but I suspect it will lead to the same result if the
> matrix is somehow not accurate enough...
No. Since the camera vectors are calculated by POV in this case, they
will be perpendicular.
--
Christopher James Huff <cja### [at] gmail com>
POV-Ray TAG: <chr### [at] tag povray org>
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <422ebbe7$1@news.povray.org>,
Sascha Ledinsky <sas### [at] users sourceforge net> wrote:
> But still, isn't the test POV performs too strict?
No. The test does not cause any problems that can't be fixed by using
correct input. This is a very simple, minor problem which occurs very
rarely and has a simple fix and several possible workarounds.
--
Christopher James Huff <cja### [at] gmail com>
POV-Ray TAG: <chr### [at] tag povray org>
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Sascha Ledinsky
Subject: Re: Parse Warning: Camera vectors are not perpendicular.
Date: 9 Mar 2005 12:27:49
Message: <422f3215$1@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Christopher James Huff wrote:
> In article <422eb8bb$1@news.povray.org>,
> Sascha Ledinsky <sas### [at] users sourceforge net> wrote:
>
>
>>That should work, but I suspect it will lead to the same result if the
>>matrix is somehow not accurate enough...
>
>
> No. Since the camera vectors are calculated by POV in this case, they
> will be perpendicular.
>
I've found the problem and it does work now with the matrix keyword as well.
I should have checked my code earlier. Again, sorry!
-sascha
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Sascha Ledinsky <sas### [at] users sourceforge net> wrote:
> Thank you!
>
> To be honest, I did not know how to quickly check if the matrix is
> correct, and since the resulting images looked right... :-/
>
> I have found the problem: The quaternion used to compute the matrix uses
> single precision floats. The fix was to first create a double-precision
> quaternion from it, then re-normalize that and feed the double-precision
> quaternion into the matrix...
Ok, so it was the Java3D package that used single precision floats ?
Btw.: I hope that you spotted my error in this part of my code:
#declare vN1 = vnormalize(vR1);
#declare vN2 = vnormalize(vcross(vN1, vR2));
#declare vN3 = vcross(vN2, vN1);
It should be:
#declare vN1 = vnormalize(vR1);
#declare vN3 = vnormalize(vcross(vN1, vR2));
#declare vN2 = vcross(vN3, vN1);
Btw.: I also recommend that you google for the "Gram-Schmidt process".
> Thanks again!
I'm glad that I could be of any help to you.
> But still, isn't the test POV performs too strict?
> I understand that POV-Ray must use double precision math for most
> operations, but would, in this case, the single-precision matrix really
> break the vista buffer?
> This will enforce all external applications that are used to create
> POV-scenes to use double-precision math throughout, and I don't know if
> it is available in all (script) languages...
I don't have any strong opinions regarding this. (And I don't really know if
such a matrix could cause any problems with the vista buffer.)
You may have a point, but if I had this problem myself, I would just
"correct" the matrix "manually" with a few lines of POV-script.
--
Tor Olav
http://subcube.com
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Sascha Ledinsky
Subject: Re: Parse Warning: Camera vectors are not perpendicular.
Date: 10 Mar 2005 12:04:01
Message: <42307e01@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> Ok, so it was the Java3D package that used single precision floats ?
Sort of... I don't know if it can be considered as a bug: The double
precision 4x4 matrix class (Matrix4d) has a setRotationScale() method
that takes a Quaternion as argument - either float (Quat4f) or double
(Quat4d). The thing is, if you use a float quaternion on the double
matrix, it seems that it does not re-normalize the quaternion after
conversion to doubles.
Now I do
public void setOrientation(Quat4f orient_float) {
Quat4d orient_double = new Quat4d(orient_float);
orient_double.normalize();
matrix.setRotation(orient_double);
}
which fixes the problem...
I'm not sure if Sun's official J3D package has the same problems - I'm
using it in an open source project and so I'm forced to use an
"inofficial" javax.vecmath package :-(
POV-Ray is happy with the new truly double-precision matrix, so I'm
happy too :-)
Thanks again,
-Sascha
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |