Search Unity

Question Disconnecting audio scene rotation from video scene rotation

Discussion in 'AR/VR (XR) Discussion' started by Nacherdj, Aug 19, 2020.

  1. Nacherdj

    Nacherdj

    Joined:
    Aug 12, 2020
    Posts:
    8
    I am building an open-source head rotation tracker with a teensy board and a GY85 with an accelerometer, gyroscope, and magnetometer. I am using Max/MSP to send the angles with Euler or quaternion. What I would like to do is take the rotation of my head to control the rotation camera of the player to move around like VR but in 2D modality (screen/monitors)

    To be honest, what I really need is to program the audio listener (or the appropriate script) to be sync with the head-tracker. The aim of the project is to be able to move your head to locate better sounds in 3D, as we do in real life. I do expect to find a certain reduction in the front-back confusion and improve the accuracy of elevated sounds using this theory. At the moment, it works with the camera, now I need to target the "ears" of the player, to be controlled by the head-tracker. I hope this has sense and gives you an approach to what I am trying to achieve.

    I could make work to move the rotation of the camera with the head-tracker angles, however, I just need to be able to move the "ears" to be able to move just the audio listener and not the camera, otherwise is very awkward.

    Thanks in advance,
    Regards.
     
  2. sfjohansson

    sfjohansson

    Joined:
    Mar 12, 2013
    Posts:
    369
    The Audio Listener is by default attached to the camera, it' just a component that you can remove/attach to any game object you see fit.
     
  3. Nacherdj

    Nacherdj

    Joined:
    Aug 12, 2020
    Posts:
    8
    Thanks for your reply, the thing is that I am doing an experimental project. I am trying to look for a solution to the problem which seems not to be pretty easy. I need to move the listener rotation that will be manipulated by the head-tracker but, still needs to be attached to the camera. Basically, the audio listener should be taking values from the OSC messages and not from the mouse. Does it have any sense?
     
  4. sfjohansson

    sfjohansson

    Joined:
    Mar 12, 2013
    Posts:
    369
    So you can put the audio listener on a game object and then rotate/position that game object with a script any way you like, in relation to the camera or completely independently.
     
  5. Nacherdj

    Nacherdj

    Joined:
    Aug 12, 2020
    Posts:
    8
    Ok, I will try that. Thank you very much