What are the changes needed to setup an orthographic camera ?
I know I have to use XMMatrixOrthographicLH
but what about update view matrix and update function ? what should be changed?
Do you have any references for implementing it ? Because its not referenced in your book.
There’s nothing special you need to worry about with respect to the view matrix. If you were writing an orthographic camera component, you might split a class hierarchy into Camera, PerspectiveCamera, and OrthographicCamera — where the Camera class becomes an abstract base class with a pure virtual UpdateProjectionMatrix method. The base Camera class would then contain properties for position, direction, up, right, view matrix, projection matrix, near/far planes, but would move Perspective/Orthographic-specific fields to their associated derived classes. For example, the PerspectiveCamera class would contain field of view and aspect ratio members; and an OrthgraphicCamera class would contain view width and view height fields. These derived classes would then implement the UpdateProjectionMatrix method with the XMMatrixPerspectiveFovRH or XMMatrixOrthographicRH methods, respectively.