Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Listener rotation  (Read 11205 times)

0 Members and 1 Guest are viewing this topic.

Tex Killer

  • Full Member
  • ***
  • Posts: 242
    • View Profile
Re: Listener rotation
« Reply #15 on: May 23, 2012, 09:24:38 pm »
Laurent, I think the solution you proposed would not solve the problem in hand.



If I understood correctly, you proposed something like the left scheme, but what would be correct is the right scheme.

The Y axis would be rendered correctly, but the X axis would be mistanken for "front/back" instead of "up/down". In other words, the listener would not be facing the floor of the game, as the view is.

For example, the S1 sound would be in front instead of up, and the S2 sound would be in the back instead of down.
« Last Edit: May 23, 2012, 09:26:23 pm by Tex Killer »

model76

  • Full Member
  • ***
  • Posts: 231
    • View Profile
Re: Listener rotation
« Reply #16 on: May 25, 2012, 09:23:41 am »
Sorry about the delay once again. I have simply been too exhausted to sit down at the computer without falling asleep. ;)

I have been thinking about the implications of the "up" vector you mentioned, but I haven't figured it out completely yet.

Let's try with some illustrations. First, to avoid confusion, here are 3 pictures of the listener:


A top-down view of the listener



The listener seen from the back

In the next image, imagine that the purple background is the 2d plane of the game world:

This is the default mode of SFML. It makes perfect sense and is easy to understand.
The red arrows represent the way I would like to rotate the listener, which isn't possible.

The following picture represents your first suggestion for what I could do instead:

The problem with this is that some sounds will end up behind the listener, which is not desired.

So... That brings us up to now. Your new suggestion is that I translate x/y coordinates of the 2D game world to the x/z coordinates of the listener's 3D world. But I don't see how that changes anything. I still can't rotate the listener to follow the view. I can make him look in different directions, but I can't mare him stand on his head, no matter which way is defined as "up".

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Listener rotation
« Reply #17 on: May 25, 2012, 09:53:12 am »
I understand.

I have to think more about it, and see how this can be solved (with or without adding something to SFML).
Laurent Gomila - SFML developer

 

anything