360' rotation openAL

Started by
5 comments, last by mike4linux 13 years, 9 months ago
HI
values in a 360' rotation go from f.ex. 0-180-0. Now the problem is to play sound only once f.ex at 20. To complicate even more there's sound attenuation. Boolean etc. nothing works. Thanks

last unsuccessful:
if (lNX > 0.0){
SourcesPos[2][0] = SourcesPos[2][0];
SourcesPos[2][1] = SourcesPos[2][1];
SourcesPos[2][2] = SourcesPos[2][2];
}else{
SourcesPos[2][0] = lX/10;
SourcesPos[2][1] = lY/10;
SourcesPos[2][2] = lZ/10;
}

[Edited by - mike4linux on July 6, 2010 4:51:51 AM]
Advertisement
// Orientation of the listener. (first 3 elements are "at", 3 are "up")
ALfloat ListenerOri[] = { 0.0, 0.0, -1.0, 0.0, 1.0, 0.0 };

I understand "at" but "up"? Thanks
You could be upside down, tilt your head to the right and the perceived sound will change. I'm guessing you only need 0, 1, 0.
Thanks but no effect. I need it for an airplane so moving all axes?

Seems that the sources positions are not moving/rotating only the camera

[Edited by - mike4linux on July 6, 2010 12:59:13 PM]
Are you updating the source position every time the camera position updates? Also

SourcesPos[2][0] = SourcesPos[2][0];SourcesPos[2][1] = SourcesPos[2][1];SourcesPos[2][2] = SourcesPos[2][2];

This does nothing useful.
sure that's in the same loop as the listener:

if(state != AL_PLAYING)
{
SourcesPos[1][0] = lX/10;//lNX/10;
SourcesPos[1][1] = lY/10;
SourcesPos[1][2] = lZ/10+1;

alSourcefv(Sources[1], AL_POSITION, SourcesPos[1]);

alSourcePlay(Sources[1]);

with the listener as 0,1,0,0,1,0 as you suggested nothing moves at all. So as for now i have listener 0,0,-1,0,0,-1?
I give up. Anyone could help me? I've got camera/listener x,y,z and heading as well as source x,y,z,heading and roll, pitch.
Airplane sounds front and back in OpenAL, C++, OpenGL
Would be great.



[Edited by - mike4linux on July 8, 2010 12:03:33 PM]

This topic is closed to new replies.

Advertisement