Game Development Reference
In-Depth Information
This will give us a projection matrix with a projection center in the middle of each screen,
however for HMDs we need the projection center to be the center of the eye, we can create
a matrix that will translate the projection center for each eye into the correct position.
We will calculate an absolute offset to apply on the horizontal direction h in meters to cor-
rect for different screen sizes, and then rescale into viewport coordinates.
It is important that the offset is applied by half the interpupillary distance in world units,
you will need to convert real-world units back into game-units.
Thevalueof h isnowtheabsolutehorizontaloffsetweneedtoapplytoourprojection mat-
rix such that:
Where h willbepositiveforthelefteyecorrectionandnegativefortherighteyecorrection.
P' is the final non-distortion corrected projection matrix. The game's view transform also
has to account for the eye position shift, similarly we will create a transform matrix that
will apply the interpupillary distance correction for each eye.
Search WWH ::




Custom Search