I can’t seem to properly convert my coordinates in OpenGL-style (right handed) to FMOD-style (left handed).
I negate all z-coordinates (sound-points as well as listener), and also fz, and tz in FSOUND_3D_Listener_SetAttributes. (the forward vector is negated because the matrix is always the opposite of the view-direction)
I use this code to with FSOUND_3D_Listener_SetAttributes:
FSOUND_3D_Listener_SetAttributes(p, 0, -m, -m, m, m, m, -m);[/code:ydgk1um6]
when I look at a sound-point from the front it works fine, but when I look at it from the top-down, it thinks I’m looking from the right side.
After two hours all the x’s, y’s and z’s are spinning through my head. Maybe someone has a clear view of this.
- bass asked 15 years ago
Thnx for the reply Serac, but it’s still not clear to me.
I use your axes system A. +Y is up, +X is right, and -Z is forward.
FMOD uses +Y as up, +X as right, and +Z as forward.
So all I have to do is negate all z-values I pass to it, in all function-calls.
And yes it works, as long as I don’t view a sound-point for the top down. I get the behind-sound (the troubled sound, heard when you’re facing a point with your back) when the point is on the right side of my screen, and the in-front-sound when it’s on the left side. So it thinks I’m at the right-hand side of it, facing towards it. This is very strange.
I hope you understand what I mean.
Right-handed systems can be interpreted two ways:
[code:1pal1qyp]a) Y b) Z
| | Y
| | /
A, represents the view where X and Y map to the screen’s X and Y, and the Z axis points outwards. B, represents the view where X and Z map to the screen’s X and Y, and the Y axis points inwards. Most math texts prefer view B for right-handed systems, since they like to treat Z as the “sky” or “up” vector.
Most computer applications use a left-handed system identical to view B above, but the Y and Z vectors are switched. Y seems to be the prime choice for “sky” or “up” these days, and Z indicates depth into the screen.
So all you need to make sure which form above you are using. If you are using A, then you [b:1pal1qyp]do[/b:1pal1qyp] need to negate the forward vector as the camera faces the “negative Z” direction. If you are using B, then you need to only switch the Y and Z vectors and no negation is required.
If you are using some other arrangement (Unreal, for instance, uses strange axes system 😉 ), then draw it out first. Understand what really means “up” and what really means “forward”.
I hope this helps…
Please login first to submit.