Why I get meshes not in the middle using orthographic matrix

Started by
0 comments, last by Jeromes 1 year ago

I try to implement shadow mapping in own project. I set up a sphere and a gird meshes in origin then places Lookup camera above them.

I expect to see the sphere and the gird in the middle of a shadow map

but they were shifted to the right side. I don't get why this happens.

float projection_plane_width = 100.0f;
float projection_plane_height = 100.0f;
float near_plane = 0.0f;
float far_plane = 1000.0f;
XMMatrixOrthographicOffCenterLH(-projection_plane_width, projection_plane_width, -projection_plane_height, projection_plane_height, near_plane, far_plane);

XMMatrixLookAtLH(Vector3(0.0f, 400.0f, 0.0f), Vector3(0.0f, 0.0f, 0.0f), Vector3(1.0f, 0.0f, 0.0f));
Advertisement

This topic is closed to new replies.

Advertisement