0
0

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:
[code:ydgk1um6]float m[16];
glGetFloatv(GL_MODELVIEW_MATRIX, m);
FSOUND_3D_Listener_SetAttributes(p, 0, -m[2], -m[6], m[10], m[1], m[5], -m[9]);[/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.

• You must to post comments
0
0

Right-handed systems can be interpreted two ways:
[code:1pal1qyp]a) Y b) Z
| | Y
| | /
| |/
*—–X *—–X
/
/
Z[/code:1pal1qyp]
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…

• You must to post comments
0
0

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.

• You must to post comments
0
0

Try negating your up vector in the listener attributes, that seemed to work for me.

Karg

• You must to post comments
0
0

You are right, the up-vector must not be negated (except for the z-value that is).

but it still doesn’t solve the problem

(I changed the code in my previous post, so now it is more right ๐ )

• You must to post comments
0
0

I think the cause of this problem is related to fmod, and not to the code I use. I found out that it one occures when the listener is placed EXACTLY above ( Y ) the sound-point.

I sent Brett an e-mail to find it out.

• You must to post comments
Showing 5 results