Change of coordinates in 3D

375 Views Asked by At

It's been a while since my last geometry class and I need some help in solving a very simple problem I have.

I need to implement a zoom function in 3D in a piece of software I am writing. My system of coordinates is described in terms of position by the X, Y and Z coordinates and in terms of orientation by Pitch, Head and Roll angles.

The original orientation of the system of coordinates is Pitch -90°, Head 0° and Roll 180°. The Zoom in this system will be achieved by a movement on the Z axis.

When the system changes it's orientation, I want the zoom to still be a movement on the Z axis of the original system and not on the new one.

I figured out what the steps I need to take have to be, but I don't master the mathematics behind them. Please, someone correct me if I'm wrong:

  1. transform the coordinates of my second system to coordinates in the first system
  2. modify the value of Z to perform the zoom action (increase /decrease Z by an amount)
  3. transform the new coordinates back to coordinates in the second system

Could someone please tell me how I can achieve this and if my approach is correct.

I apologize in advance to anyone that finds this question to be too simple.