I’m still having a hard time understanding the FMod coordinate system in relation to the OpenGL coordinate system.
I have some sound emitting object with these OpenGL coordinates (x,y,z), stored in FMOD_VECTOR objectpos:
20910.4, -21.1514, -21543.7
I have a camera i.ex. with these OpenGL coordinates (x,y,z), stored in FMOD_VECTOR camerapos:
20911.5, -20.7203, -21543.1
Now I wanted to find out how the sound changes if I move my camera.
So I tried to set the channel 3D position to the one of the sound emitting object:
result = channel1->set3DAttributes(&objectpos, &vel, 0);
Next I made a loop which keeps reading the camera position and calls the update() on FMod. Inside this loop I set the 3DListenerAttributes:
result = systemi->set3DListenerAttributes(0, &camerapos, &vel,
&listenerforward, &up); ERRCHECK(result);
The problem is I dont hear the sound. I assume this is because the coordinates are “out of scope” of FMOD. So far I didn’t find any information on the “scope” of the coordinate system of FMod besides that it is normalized some way. Does it expect values from 0.0 to 1.0? How would I get such normalized values?
I have no clue how to “translate” my OpenGL values to something FMod can handle?
(Just as a sidenote, if I manually set the positions to something “nice”, like -100.0f, 0.0f, 0.0f, I can hear the sound. So the problem is not that my FMod system in general is not working right and not the problem.)
Any help is very appreciated. Thank you!