Game Development Reference
In-Depth Information
Figure 3.12 Sample right-handed (a) and left-handed (b) coordinate systems.
A Coordinate System Mix-Up
On Lord of the Rings: Conquest , one of my primary responsibilities
was to provide programming support for the sound team. Early on in
the project, the lead sound designer came to me with a peculiar issue.
He noticed that when an explosion occurred on the left side of the
screen, it came out of the right speaker, and vice versa. He had checked
his speaker wires several times, and was sure that he had the correct
speakers connected to the correct inputs on the receiver.
A bit of digging around uncovered the issue: Most of our game's code
used a left-handed coordinate system, whereas our third-party sound
library used a right-handed coordinate system. This resulted in the
wrong coordinates being passed into the sound system. The solution
was to convert the coordinates to right-handed when passing them in-
to the sound library. Once this was changed, the sounds started coming
out of the correct speakers for the first time on the project.
By default, DirectX uses a left-handed y-up coordinate system, and OpenGL uses
a right-handed y-up coordinate system. However, this does not mean that all
 
Search WWH ::




Custom Search