Advertisement Jump to content


This topic is now archived and is closed to further replies.

Jonny K

I need a hand figuring out OpenAL's 3D sound...

This topic is 5344 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

My game is a 2D top-down kind of shooter. I''m setting up the 3D sound so that you hear the world from the perspective of the hero ship. As the ship moves near an alien, you will hear the hum of the alien engines. That kind of thing... But since I''m working in two dimentions, it''s a little tricky to figure out how to configure OpenAL. For instance: //Where I''m facing, and the up direction float listenerOri[]={0.0,1.0,0.0, 0.0,0.0,-1.0}; alListenerfv(AL_ORIENTATION,listenerOri); Now I''m doing all my drawing on an X,Y coordinate system between 0,0 and 1,1. Therefore, I''m looking into the Z axis I guess, with the Y axis heading up, and the X axis across. Have I set the orientation properly? From the perspective of the hero ship (remember, I''m looking down at it), the ship is facing toward the Y axis (looking up from my perspective). Therefore, the ship is facing Y, and the up direction is...negative Z? (toward the camera). ALso, it seems that no matter how far away something is, I can still hear it. How do I make it so that I only hear the sounds when they are close to me? I''ve played with settings like "AL_MAX_DISTANCE", and "AL_ROLLOFF_FACTOR", but I''ve had no luck. Thanks.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!