[openal] [MATH] - A few questions about how I can rotate the listener?

WSean s.tolstoyevski at gmail.com
Fri Mar 26 16:50:41 EDT 2021


Hi all,

As a blind developer, Youtube videos don't work for me. Okay, there is a 
lot of good content there. But everything is visual.
I couldn't take advantage of the game developers' videos about at and up 
vectors.
And I also read a few forum discussions on this topic.

I know math. There is no problem here.
But to be honest, I'm insufficient in trigonometry and giometry. This 
problem of the education system in Turkey more than me.

Anyway.

I will also send the codes if requested, but now I will only describe 
them as pseudocode.

There is a source.
Location (-12.0, 0, 2.321)
And I'm at 0.
If I understood the spatial space correctly here, if the position of the 
listener does not change, by default the sound will come from the left 
side. So I'm looking ahead. The sound is closer to my left ear.

In other words, the sound is in my west (270 degree). And I'm looking north.


If we think I am a player now, I will turn left with the mouse. So I 
want the source to be in front of me after I return to left. And a 
little above.
The sound should come from above because the Z-axis is positive (2.231).

I don't understand how I can turn the listener.

In the first case, I want to get the sound on my left in front of me.

What is the mathematical formula here?

* * *
This was about the x and y axis.

Another question:

There is a helicopter in the sky. It's flying.
For example the z value is 15 .
Normally I look straight ahead. The sound  must come from above.
But I want to raise my head and return to the helicopter. It's like a 
player who wants to take Helicopter into aim.
I don't really understand this vector.

I can understand if you write an example for the pseudocodes I wrote.

People write solutions with pen and paper or digital images. But I can't 
get to that.



More information about the openal mailing list