I multiply a matrix with a position vector to get a new position, however, now I need to change my matrix from y-up coordinate space to z-up. Changing only the matrix won't work: how to apply the change to the vector (change position vector from y-up to z-up)?
|
|
You need to be more clear about the coordinate systems you're converting from and to (for instance, when Y is up, in which direction does Z point, etc). But either way it's simple to derive your matrix. I'll just do an example using this assumption:
Think what happens to each axis on the left side, when it's converted to the right side:
One idea is to encode the changes above in a simple matrix, such as the one below. It should be easy to understand the correlation between the matrix and the description above, but I've also added the multiplication so you can see the way in which it modifies the result.
This is actually just a 90 degrees rotation matrix. You could concatenate this matrix at the end of your previous transformation, so that the conversion is done automatically as part of the matrix multiplication. Or, alternatively you can just do it manually at the end like:
|
|||||||||
|