360' rotating sound positions (openal)

  • Follow


Hi
   cannot find any OpenAL examples/forum to help me. Now heading goes 
from 0 - 180 - 0 using fmod which i need for sound attenuation. Two 
problems with that:
- same values on both sides but I need only to play sound only on one 
position.
- initial heading not null messes things up. F.ex. 30' goes to 0 and 
back up to 150 etc.

           180


90        car       90


            0


my current code looks alike:
cH is a value in degrees

	if (cH > 180)
	{
	headingCam = fmod(cH, 180);
	}else{
		headingCam = 180 - fmod(cH, 180);
	}


Many thanks
Michael
0
Reply Michael106 (11) 7/3/2010 6:58:29 AM

On Sat, 03 Jul 2010 08:58:29 +0200
Michael <Michael@notspam.com> wrote:

> Hi
>    cannot find any OpenAL examples/forum to help me.

And this is not the OpenAL newsgroup. This is the newsgroup of
the _graphics_ API "OpenGL". Despite the similar names, OpenAL
is in no way directly related to OpenGL or its maintainers. Yes, it has
been designed along the API concepts of OpenGL, but that's it.

There are, BTW, many tutorials on the OpenAL website http://openal.org


Wolfgang

0
Reply Wolfgang 7/3/2010 4:39:16 PM


There's no active OpenAL group/forum and I cannot find any example
covering moving sources with moving listener.
0
Reply Mike 7/4/2010 12:52:18 PM

On 04/07/2010 13:52, Mike wrote:
> There's no active OpenAL group/forum and I cannot find any example
> covering moving sources with moving listener.

There appear to be some mailing lists for OpenAL. See here:

http://connect.creativelabs.com/openal/default.aspx

Failing which (I had trouble opening the pages), it looks like you might 
be able to subscribe to at least the OpenAL-Dev list here:

http://old.nabble.com/mailing_list/MailingListOptions.jtp?forum=14242

Otherwise, try the alternative game libraries forum on GameDev.net:

http://www.gamedev.net/community/forums/forum.asp?forum_id=61

The description says:

"For discussion related to SDL, Allegro, FMod, ***OpenAL***, ODE, Ogre, 
CrystalSpace, etc." (emphasis mine)

In any case, OpenAL isn't topical in the OpenGL newsgroup. (Just because 
two things sound similar doesn't make it wise to post questions on one 
to the newsgroup of the other. Consider e.g. gtk and ITK.)

Regards,
Stu
0
Reply Stuart 7/5/2010 4:21:16 PM

nothing new
0
Reply Michael 7/6/2010 7:12:34 AM

On 06/07/2010 08:12, Michael wrote:
> nothing new

Oh well. Guess I can't get that twenty minutes I spent Googling to try 
and help you back now...

*plonk*

Stu
0
Reply Stuart 7/6/2010 11:37:36 PM

"Stuart Golodetz" <blah@blah.com> wrote in message 
news:EsCdnZcz6ZnYI67RnZ2dnUVZ8hSdnZ2d@pipex.net...
> On 06/07/2010 08:12, Michael wrote:
>> nothing new
>
> Oh well. Guess I can't get that twenty minutes I spent Googling to try and 
> help you back now...

I hate it when that happens. Fuck 'em.

-- 
Charles E Hardwidge 

0
Reply Charles 7/7/2010 10:43:32 AM

openal moving source positions seems broken...
0
Reply Michael 7/8/2010 10:13:15 AM

Am Thu, 08 Jul 2010 12:13:15 +0200
schrieb Michael <Michael@notspam.com>:

> openal moving source positions seems broken...

Why do you keep spamming the OpenGL (note the 'G') newsgroup with
questions about OpenAL (note the 'A'). OpenGL is not related to OpenGL
by bloodline. They're just named similarily.

OpenGL has been developed by Silicon Graphics and is now maintained by
the Khronos Group.

OpenAL was developed by Creative Labs.


THERE IS NO DIRECT RELATION!


Please stop spamming the OpenGL newsgroup with questions about OpenAL.


Wolfgang
--=20
CIP-Rechnerbetriebsgruppe
Fakult=C3=A4t f=C3=BCr Physik - LMU M=C3=BCnchen
Schellingstrasse 4, 80799 M=C3=BCnchen

0
Reply Wolfgang 7/9/2010 12:16:02 PM

On Jul 9, 2:16=A0pm, "Wolfgang.Draxinger" <Wolfgang.Draxin...@physik.uni-
muenchen.de> wrote:
>
> Please stop spamming the OpenGL newsgroup with questions about OpenAL.
>

It's not even an OpenAL question, it's a question
about how to use fmod() and other very basic math.

0
Reply fungus 7/9/2010 5:28:39 PM

Yes a general question which could be OpenGl as well. I'm even using 
opengl for the listener orientation but am pretty confused:
http://www.devmaster.net/forums/showthread.php?t=16076
0
Reply Michael 7/10/2010 3:53:12 PM

Am Sat, 10 Jul 2010 17:53:12 +0200
schrieb Michael <Michael@notspam.com>:

> Yes a general question which could be OpenGl as well. I'm even using=20
> opengl for the listener orientation but am pretty confused:
> http://www.devmaster.net/forums/showthread.php?t=3D16076

Here are a few hints on how to get usefull answers, especially if it
comes to programing:

1) Provide source code: If you give people a look at your code, or a
  minimal excerpt, which shows, how things do (not) work, it's most
  likely, someone will post a corrected version of the code.

2) Don't annoy the regulars: Ask questions at the proper place. For
  example some of the regulars of OpenGL don't deal with sound at all.
  They're in developing CAD software, or scientific visualization.
  Those people, who are likely able to give you sensible advice,
  even if it's outside their field, easily get annoyed and will put you
  on their filter lists. If someone tells you kindly, that you're in
  the wrong place, please heed that advice. If you can't find the place
  you're looking for, don't come back whining.

3) Google is your friend.

4) Before asking questions, which may put you to shame later, try
  finding some existing examples about how to solve the problem you
  have, or similar problems. Play around with those examples, make
  change to their code.

5) Google is your friend.

6) If your problem is related to math make sure, you've probably
  understood the mathematical properties of the problem. Double check
  that you made no mistake.

7) Don't reinstanciate the questions if you don't like the reply. Also
  don't accuse the regulars to be unwilling to help, if you violated 2).


Now to get you in the right direction:

*1) you didn't do that. Can't help you there, I don't have a crystal
    orb, and AFAIK those of the other regulars are broken.

*2) I mentioned that point, nuff said.

*3) http://lmgtfy.com/?q=3Dopengl+openal+example

*4) see *3)

*5) see *4)

*6) Angles go from 0=C2=B0|0 to 360=C2=B0|2pi. If you want to place your pi=
vot
    somewhere else you may apply a phase shift. A heading going from 0
    to 180 back to 0 makes no sense at all. -180 to 0 to +180, that
    would make sense. Or 0 to +180, then a discontinouity to -180=C2=B0 and
    from there back to 0=C2=B0. Note that all nonhyperbolic trigonometric
    functions are inherently modular. Because of that you should not
    clamp input values for those during development, as this may
    conceal bugs. Later on you may add modulo 360=C2=B0|2pi operations to
    keep values in range. Your application of modulo 180=C2=B0|pi is just
    wrong.

*7) see *2)

BTW OpenAL ships with a nice demo of how to use OpenAL together with
OpenGL. Also you should keep in mind that OpenAL sound sources behave
like light sources in OpenGL.


Wolfgang

0
Reply Wolfgang 7/10/2010 10:49:48 PM

Ich k=F6nnte das doch in OpenGL machen? So etwa:
               	glPushMatrix();
                	glLoadIdentity();
                	glTranslatef(localX/10, localY/10, localZ/10);
                	glRotatef	(-psi, 0.0,1.0,0.0);
                	glRotatef	(-pTheta,-1.0,0.0,0.0);
                	glRotatef	(-pPhi, 0.0,0.0,1.0);
 			glPopMatrix();

Wie kann ich denn nun die neuen Werte =FCbernehmen?
           			alSourcefv(Sources[1], AL_POSITION, Sour...
Danke
0
Reply Mike 7/11/2010 11:29:47 AM

I could do that in OpenGL? alike:
                glPushMatrix();
                        glLoadIdentity();
                        glTranslatef(localX/10, localY/10, localZ/10);
                        glRotatef       (-psi, 0.0,1.0,0.0);
                        glRotatef       (-pTheta,-1.0,0.0,0.0);
                        glRotatef       (-pPhi, 0.0,0.0,1.0);
                        glPopMatrix();

But how to use the new values?
                                alSourcefv(Sources[1], AL_POSITION,
Sour...
Thanks
0
Reply Mike 7/11/2010 11:31:37 AM

On Sun, 11 Jul 2010 04:31:37 -0700 (PDT)
Mike <michael.sgier@gmail.com> wrote:

> I could do that in OpenGL? alike:
>                 glPushMatrix();
>                         glLoadIdentity();
>                         glTranslatef(localX/10, localY/10, localZ/10);
>                         glRotatef       (-psi, 0.0,1.0,0.0);
>                         glRotatef       (-pTheta,-1.0,0.0,0.0);
>                         glRotatef       (-pPhi, 0.0,0.0,1.0);
>                         glPopMatrix();
> 
> But how to use the new values?
>                                 alSourcefv(Sources[1], AL_POSITION,

IMHO one of the biggest fallacies of the OpenAL API is, that it allows
to set listener vectors. Just keep the listener in the origin, looking
into negative Z direction, with 0 velocity.

Just transform the sound sources around. Positions transform by your
OpenGL modelview matrix (just like vertex positions), velocity vectors
beave like normals, so these must be transformed by the inverse
transpose of the modelview matrix. Then just subtract the listener
velocity vector from the transformed source velocities. Then use these
values for the sound sources.


Wolfgang

0
Reply Wolfgang 7/11/2010 12:39:07 PM

So why is this not working?
--------
                	glPushMatrix();
                	glLoadIdentity();
                	glTranslatef(lX/10, lY/10, lZ/10);
                	glRotatef	(-pPsi, 0.0,1.0,0.0);
                	glRotatef	(-pTheta,-1.0,0.0,0.0);
                	glRotatef	(-pPhi, 0.0,0.0,1.0);

                	alSource3f(Sources[1], AL_POSITION, lX/10, lY/10, lZ/
10);
                	glPopMatrix();
-------
Thanks
0
Reply Mike 7/12/2010 8:54:53 AM

On Mon, 12 Jul 2010 01:54:53 -0700 (PDT)
Mike <michael.sgier@gmail.com> wrote:

> So why is this not working?
> --------
>                 	glPushMatrix();
>                 	glLoadIdentity();
>                 	glTranslatef(lX/10, lY/10, lZ/10);
>                 	glRotatef	(-pPsi, 0.0,1.0,0.0);
>                 	glRotatef	(-pTheta,-1.0,0.0,0.0);
>                 	glRotatef	(-pPhi, 0.0,0.0,1.0);
> 
>                 	alSource3f(Sources[1], AL_POSITION, lX/10,
> lY/10, lZ/ 10);
>                 	glPopMatrix();
> -------
> Thanks

For the same reason, OpenAL questions don't belong here: OpenAL does
not interact with OpenGL, period.


Wolfgang

0
Reply Wolfgang 7/12/2010 9:28:21 PM

jerk
0
Reply Michael 7/13/2010 5:45:12 AM

On Tue, 13 Jul 2010 07:45:12 +0200
Michael <Michael@notspam.com> wrote:

> jerk

Excuse me?!

Do you realize, that all the other regulars probably had put you in
their filters quite early on. That was the 5th attempt, I trying to
make you realize, that you're barking up the wrong tree.

I told you in my very first reply, that OpenAL and OpenGL are not
related. Why on earth did you come to think then, that by putting an
OpenAL call between OpenGL calls, OpenAL will be influenced by OpenGL?

THERE'S NO RELATIONSHIP BETWEEN THEM!

THERE'S NO INTERACTION BETWEEN THEM!

And I already told you, how to use them in a program, so that the
output of both is consistent.


Wolfgang

0
Reply Wolfgang 7/13/2010 8:45:16 AM

Wolfgang Draxinger wrote:
> On Tue, 13 Jul 2010 07:45:12 +0200
> Michael <Michael@notspam.com> wrote:
> 
>> jerk
> 
> Excuse me?!
> 
> Do you realize, that all the other regulars probably had put you in
> their filters quite early on. That was the 5th attempt, I trying to
> make you realize, that you're barking up the wrong tree.

I haven't, because I always expect some fun. btw replying seams 
pointless (as this thread shows) :)
0
Reply Vladimir 7/13/2010 9:44:51 AM

19 Replies
105 Views

(page loaded in 0.658 seconds)

Similiar Articles:




7/30/2012 6:18:17 AM


Reply: