[Openal-devel] AL_SOURCE_RELATIVE behavior

Erik Hofman erik at ehofman.com
Sun Mar 11 01:30:14 PST 2012


On Sat, 2012-03-10 at 15:02 -0800, Chris Robinson wrote:
> Hey guys. I'm hoping to get some clarification on something.
> 
> Up to now I had been working under the assumption that the AL_SOURCE_RELATIVE 
> source property made the source completely relative to the listener. That is, 
> a position of {0,0,0} would always be at the listener and {0,0,-1} would 
> always be in front in front of it, while a direction of {1,0,0} would always 
> face to the right of the listener, a velocity of {0,0,0} would always match 
> the listener's velocity, etc.
> 
> Reading the 1.1 spec, it says this:
> 
> "AL_SOURCE_RELATIVE set to AL_TRUE indicates that the position, velocity, 
> cone, and direction properties of a source are to be interpreted relative to 
> the listener position."
> 
> Now, although it says it makes the source's position, velocity, cone, and 
> direction properties relative to the listener position, the source's velocity 
> and direction (and cone) are not affected by the listener position, just the 
> source's position in relation to the listener position. That, coupled with the 
> idea of what a relative source should be, can easily lead people to assume the 
> source properties are simply relative to the listener as a whole.

My interpretation has always been that all sources are to be realigned
such that the listener is located at { 0.0, 0.0, 0.0 } and (the listener
is) facing { 0.0f, 0.0f, -1.0f,  0.0f, 1.0f, 0.0f }. Anything else would
make it almost impossible to use matrix functions internally.

So I would say all properties are relative to the listeners equivalent.

Erik



More information about the Openal-devel mailing list