Hi,

i did browse the documentation and forums and did some experiments myself, but I’m still clueless nonetheless.

I use the set3DListenerAttributes to adjust the ‘ears’ of my camera. Position works fine, I did not try velocity yet.

But I don’t get ‘forward’ and ‘up’. I guess forward is the X and up the Y axis, together forming the direction at which i look. But then I could do with just a float, no need for a vector. So it must mean something else. I cannot find an explanation about that in the manual.

Also, there is no mention of the scale that is used in those values. 0/360, 0/1, -1/1… tried them out but I did not get a clear result.

If you would be so kind to explain these concepts to a new user, or just point me to a place where i can find more about it, that would help a lot.

Thanks!

- yvanvds asked 8 years ago

- You must login to post comments

[quote:jix55a8q]I guess forward is the X and up the Y axis, together forming the direction at which i look.[/quote:jix55a8q]

Correct so far.

[quote:jix55a8q]But then I could do with just a float, no need for a vector.[/quote:jix55a8q]

A single float cannot represent an orientation in 3D space. It could represent a rotation about the Y axis, but that would restrict the listener to only looking along the X-Z plane; this would be the ‘yaw’ of the system. Adding another float for ‘pitch’ would add up and down movement and then another for ‘roll’ about the local Z axis would be required to properly describe a 3D orientation. This is the Euler angle system and those rotations are order sensitive which is one reason why it is undesirable. Using vectors for the forward and up vectors is more robust and suits the matrix based orientation commonly used in 3D applications.

[url=http://en.wikipedia.org/wiki/Tait-Bryan_angles:jix55a8q]Euler Angles[/url:jix55a8q]

[quote:jix55a8q]Also, there is no mention of the scale that is used in those values. 0/360, 0/1, -1/1… tried them out but I did not get a clear result. [/quote:jix55a8q]

All these vectors are normalized vectors. This means they have a length of one. The length of a vector is the square root of the sum of the components squared.

i.e. length = sqrt( (vec.x)^2 + (vec.y)^2 + (vec.z)^2 )

So the forward vector is the unit vector which describes the direction the listener is facing. So if the listener is facing along the X axis forward vector would be (1, 0, 0)

NOTE: sqrt( (1)^2 + (0)^2 + (0)^2 ) = sqrt( 1 ) = 1

Assuming you are making a graphical application. this information can usually be taken from the camera class in most rendering engines and doesn’t need to be calculated manually.

Hope this helps,

-Pete

- Guest answered 8 years ago

- You must login to post comments

**Your Answer**

Please login first to submit.