Confusion over orientation of vectors

so, I’m a bit confused on the docs about System::set3DOrientation. In the parameters for forwards and upwards orientation, it says:

  • forward: The forwards orientation of the listener. This vector must be of unit length and perpendicular to the up vector. You can specify 0 or NULL to not update the forwards orientation of the listener.
  • up: The upwards orientation of the listener. This vector must be of unit length and perpendicular to the forwards vector. You can specify 0 or NULL to not update the upwards orientation of the listener.

My confusion arises because both vectors must be perpendicular. However, I’m not sure how to calculate a vector that is perpendicular to my forward one. Statically, I know that the perpendicular vector of (0, 0, 1) and (0, 1, 0) is (-1, 0, 0) if (0, 0, 10 is my starting forward orientation and (0, 1, 0) is my starting upward orientation. However, in a context such as a game where I want the player to be able to turn 15 degrees per turn (thereby altering the forward but not upward orientation of the listener), I (currently) set the new x coordinate of the forward orientation to sin(theta pi/180) and the z coordinate of the forward orientation to cos(theta pi/180). I can’t, however, use this same method for the upward orientation, since the Z axis doesn’t apply (I don’t think). If I try setting the x and y coordinates to the same values, the player then cannot turn left or right, but can continue orienting upwards (that is, once the listeners upward orientation is set, orienting on the forwards axis becomes impossible). So, how can I allow the forward orientation to be altered freely while allowing the listeners upward orientation t also be freely altered without FMOD complaining that the vectors are not perpendicular?

Hi Ethin,

In order to give the best answer, could you let us know the following:

  • Where are you seeing this System::set3DOrientation function? What version of FMOD are you using?
  • What setting is this game? Is it a 2D top-down? Sidescroller? What kind of camera perspective? Is the listener on the player or on the camera? Could you perhaps provide a screenshot?

In the meantime, take a look at the documentation for the built-in parameters - these provide some helpful images to better visualise vectors.
https://www.fmod.com/resources/documentation-studio?page=built-in-parameters-reference.html

Thanks,
Richard

Hi Ethin,

Are you still having problems with orienting vectors?

Thanks,
Richard

Yes, I am, but its not an absolute need. I have other problems that do take precedence (the vector orientation was just me messing around getting use to FMOD’s 3D-isms). The problem that does actually take precedence is this one (How to adjust volume of audio recording), and I have two others (though the second one won’t be important for some time). I’ll update that linked post with the two problems I need help with.