POV-Ray : Newsgroups : povray.binaries.animations : Absolutely relative woes Server Time 8 Feb 2023 04:56:45 EST (-0500)
 Absolutely relative woes (Message 1 to 4 of 4)
 From: Dick Balaska Subject: Absolutely relative woes Date: 23 Feb 2020 20:10:18 Message: <5e53227a\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#5e53227a%241%40news.povray.org",
"headline": "Absolutely relative woes",
"dateCreated": "2020-02-24T01:10:18+00:00",
"datePublished": "2020-02-24T01:10:18+00:00",
"author": {
"@type": "Person",
"name": "Dick Balaska"
}
}
This has me stumped.  In these two images, I would expect the greenish
crewman in the water to be in the exact same position.
ttbo1392 crewman is an absolute vector
ttbo1393 crewman is relative to tugboat.

The scenario is, crewman is drifting in the bathtub and gets rescued by
the Tug.  So his vector starts out absolute and the moment the rescue
starts, he becomes part of the tugboat object.

TugVec =<700.50, 144.50, 215.50> Rot=<4.04, 155.00, 1.73>
CrewVec=<697.50, 143.92, 217.00>

So, CrewOnBoatVec=vrotate(CrewVec-TugVec, y*-TugRot.y)

which gives me
CrewOnBoatVec=<2.08, 0.00, -2.63>
close, but no cigar.
Ignore the y component. That gets handled special. It's the x,z that's
the issue.

If I unwind it,
vrotate(CrewOnBoatVec, y*TugRot.y)+TugVec
I get back the original absolute CrewVec, but that just verifies the
math works, but it's still wrong.

I don't know what I'm doing wrong.
--
dik
Rendered 49,882,521,600 of 49,882,521,600 pixels (100%)
```

Attachments:
Download 'ttbo1392.png' (46 KB) Download 'ttbo1393.png' (46 KB)

Preview of image 'ttbo1392.png'

Preview of image 'ttbo1393.png'

 From: Bald Eagle Subject: Re: Absolutely relative woes Date: 23 Feb 2020 22:20:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.5e534019437c20824eec112d0%40news.povray.org",
"headline": "Re: Absolutely relative woes",
"dateCreated": "2020-02-24T03:20:00+00:00",
"datePublished": "2020-02-24T03:20:00+00:00",
"author": {
"@type": "Person",
"name": "Bald Eagle"
}
}
Dick Balaska <dic### [at] buckosoftcom> wrote:

> I don't know what I'm doing wrong.

I can't really see it either, but maybe just do a simple scene with spheres and
a for loop tracing out the rotation.

compare it to things like

CrewOnBoatVec=vrotate(TugVec-CrewVec, y*-TugRot.y)
^^^^^^^^^^^^^^

and see if anything jumps out.
```
 From: Dick Balaska Subject: Re: Absolutely relative woes Date: 24 Feb 2020 17:05:07 Message: <5e544893\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#5e544893%241%40news.povray.org",
"headline": "Re: Absolutely relative woes",
"dateCreated": "2020-02-24T22:05:07+00:00",
"datePublished": "2020-02-24T22:05:07+00:00",
"author": {
"@type": "Person",
"name": "Dick Balaska"
}
}
Am 2/23/20 10:16 PM, also sprach Bald Eagle:
> Dick Balaska <dic### [at] buckosoftcom> wrote:
>
>> I don't know what I'm doing wrong.
>
> I can't really see it either, but maybe just do a simple scene with spheres
> ...
> and see if anything jumps out.
>

Ugh.  What jumps out is ... I told a half truth.  When I perform the
calcs in actual SDL it works as expected.  When I do it in my c++
library, that I ported from my Java library, that I ripped from the
POV-Ray source (core/math/matrix.cpp), that I've used for years, I get
the wrong answer.

Comparing the logic flow of my
void Vector::rotateDegrees(const Vector& rot){}
with POV-Ray's
void Compute_Rotation_Transform (TRANSFORM *transform, const Vector3d&
vector)

I see a matrix multiplication difference (there are two different
multiplies and I used one).

I can't believe I never saw this before.

--
dik
Rendered 49,882,521,600 of 49,882,521,600 pixels (100%)
```
 From: Dick Balaska Subject: Re: Absolutely relative woes Date: 24 Feb 2020 22:44:49 Message: <5e549831@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#5e549831%40news.povray.org",
"headline": "Re: Absolutely relative woes",
"dateCreated": "2020-02-25T03:44:49+00:00",
"datePublished": "2020-02-25T03:44:49+00:00",
"author": {
"@type": "Person",
"name": "Dick Balaska"
}
}
Am 2/24/20 5:05 PM, also sprach Dick Balaska:
>
> I see a matrix multiplication difference (there are two different
> multiplies and I used one).
>
> I can't believe I never saw this before.
>

This was cool.  I set a breakpoint in my SDL debugger just before the
vrotate.  Once that hit, I set a breakpoint in the POV-Ray c++.
I then stepped through the vrotate while at the same time stepping
through my library.  Lo, I got the exact same results.

I'm in agony.

When I first saw this phenomenon, I said "interesting, the vector looks
correct, just the wrong length.  But I'm not doing any vlength work so
that's just a coincidence."  Wrong!  I scaled the Tugboat by 0.7 so he'd
fit in the tub better.  I need a drink.

--
dik
Rendered 49,882,521,600 of 49,882,521,600 pixels (100%)
```