Jump to content
  • Advertisement
Sign in to follow this  
mike4linux

360' rotation openAL

This topic is 2906 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!