1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| private void SetupMatrices()
{
device.Transform.World = Matrix.Identity;
device.Transform.View = Matrix.LookAtLH(new Vector3(headX, headY, headDist), new Vector3(headX, headY, 0), new Vector3(0.0f, 1.0f, 0.0f));
float nearPlane = .05f;
device.Transform.Projection = Matrix.PerspectiveOffCenterLH( nearPlane*(-.5f * screenAspect + headX)/headDist,
nearPlane*(.5f * screenAspect + headX)/headDist,
nearPlane*(-.5f - headY)/headDist,
nearPlane*(.5f - headY)/headDist,
nearPlane, 100);
} |
Partager