POV-Ray : Newsgroups : povray.advanced-users : Cross products in different coordinate systems. Server Time
20 Oct 2025 17:22:12 EDT (-0400)
  Cross products in different coordinate systems. (Message 1 to 3 of 3)  
From: Bald Eagle
Subject: Cross products in different coordinate systems.
Date: 18 Oct 2025 19:35:00
Message: <web.68f423c95edf66ec1f9dae3025979125@news.povray.org>
Let's suppose that I have code that uses vector cross products in a z-up
y-forward system.

Now I want replicate the code in our y-up, z-forward system to accomplish the
same task.

            What is the best / most efficient way to do this?

Do I need to re-order the vectors in the vcross (A, B) function?

or

do I actually need to change the vector coordinates that I'm using
so that z-up <X, Y, Z> = y-up <X, Z, -Y>

I want something sane, for production code.  Not something hacktastic.

- BE


Post a reply to this message

From: jr
Subject: Re: Cross products in different coordinate systems.
Date: 19 Oct 2025 13:15:00
Message: <web.68f51c3e4edf73786ddd22546cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> Let's suppose that I have code that uses vector cross products in a z-up
> y-forward system.
>
> Now I want replicate the code in our y-up, z-forward system to accomplish the
> same task.
>
>             What is the best / most efficient way to do this?
>
> Do I need to re-order the vectors in the vcross (A, B) function?
>
> or
>
> do I actually need to change the vector coordinates that I'm using
> so that z-up <X, Y, Z> = y-up <X, Z, -Y>
>
> I want something sane, ...

the latter (imo), re-order the components.


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: Cross products in different coordinate systems.
Date: 20 Oct 2025 16:00:00
Message: <web.68f6940b4edf7378438b893125979125@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> the latter (imo), re-order the components.


Actually, the answer is:  do nothing.

If we were importing/converting the DATA from one system to the other, then we
would need to change the vector components to reflect this and make everything
work properly.

When we're using the RH data in the RH coordinate space, or using the LH data in
the LH coordinate space, the code and vector functions remain unchanged.

(As mentioned in another thread, things got derailed when I had R instead of r,
so the normals were pointing every which way, and my isosurface wasn't behaving
properly either, so that just added to the confusion.)

- BW


Post a reply to this message

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