Skip to main content

OpenAL

Go Search
Home
ALchemy
Beta - Audigy [CLOSED]
Beta - Linux
Beta - Windows
Developer
E-MU
MarCom
OpenAL
Open Source
PR
  
Creative Labs: Connect > OpenAL > OpenAL > Calculating listener's orientation from pitch, yaw and roll angles  

OpenAL

Modify settings and columns
Note : This discussion forum has been CLOSED.

For questions about developing software using OpenAL please subscribe to the 'OpenAL' mailing list at http://opensource.creative.com/mailman/listinfo/openal

For questions about creating a custom OpenAL library, please subscribe to the 'OpenAL-Devel' mailing list at http://opensource.creative.com/mailman/listinfo/openal-devel
  
View: 
Post
Started: 7/11/2008 10:43 AM
Calculating listener's orientation from pitch, yaw and roll angles?
I need some help with setting the AL_ORIENTATION. How would I calculate the forward and up vectors from pitch, yaw and roll angles?
Posted: 7/12/2008 10:03 AM

I suppose the easiest way would be to build a 3x3 rotation matrix from the yaw/pitch/roll, then apply it to the vectors 0,0,-1 and 0,1,0. The result of the first will be the forward vector and the second will be the up vector.

Posted: 7/13/2008 3:00 AM
So the values should range from -1 to 1?
Posted: 7/13/2008 3:44 AM



From:
Posted: Sunday, July 13, 2008 3:00 AM
Subject: Calculating listener's orientation from pitch, yaw and roll angles?

So the values should range from -1 to 1?

They're standard directional vectors. Each value has the range -1 to 1, but the entire length of the vector equals 1. You get the length with:

length = sqrt(x*x + y*y + z*z)

Use that with the default forward vector (0,0,-1), and we get:

sqrt(0*0 + 0*0 + -1*-1) = sqrt(0+0+1) = sqrt(1) = 1

Thus the vector has a length of 1. Applying a proper rotational matrix to a vector will produce another vector that has the same length (though the actual x,y,z values may be different).