Re: WebAudio question

@2
Thanks so much for that.

So the code I have now, which I believe to be right from your instructions is:

  set theta(double value) {
    _theta = value;
    final double rads = value / 180.0 * pi;
    sounds.listener
      ..forwardX.value = sin(rads)
      ..forwardY.value = cos(rads)
      ..forwardZ.value = 0;
  }

Does that look OK to you? The double . is Dart's cascade notation. It's still not panning the way I'd expect. As I turn my virtual back to an object, it moves to the left. Ahead objects are to the right. It's like that no matter which direction I walk in.

The other thing is, if Aprone's trig is wrong, does that mean my function for getting the coordinates in a particular direction is also wrong? That could account for the panning being off.

Point<double> coordinatesInDirection(Point<double> start, double direction, {double distance = 1.0}) {
  final double x = start.x + (distance * cos((direction * pi) / 180));
  final double y = start.y + (distance * sin((direction * pi) / 180));
  return Point<double>(x, y);
}

Finally, I'm not planning to let the listener move their head. From what you're saying, that would blow my tiny mind in unimaginary ways.

Thanks again, I really appreciate all the help.



-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector

Reply via email to