Skip to content

Commit

Permalink
DX9: fix light matrix placement.
Browse files Browse the repository at this point in the history
  • Loading branch information
kosua20 authored Feb 20, 2024
1 parent 8e12b19 commit a9d13aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dx9/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ Renderer::Renderer( HWND window )

// Light init
_worldLightDir = XMVector3Normalize(XMVectorSet(1.0f, 0.6f, 1.0f, 0.0f));
_lightView = XMMatrixLookAtRH(2.f * _worldLightDir, XMVectorZero(), XMVectorSet(0.f, 1.0f, 0.f, 0.f));
_lightView = XMMatrixLookAtRH(5.f * _worldLightDir, XMVectorZero(), XMVectorSet(0.f, 1.0f, 0.f, 0.f));
_lightProj = XMMatrixOrthographicRH(10.f, 10.f, 0.1f, 10.f); // This will never change


Expand Down Expand Up @@ -339,7 +339,7 @@ void Renderer::update(const MouseState& mouse, double time, double deltaTime) {

_proj = XMMatrixPerspectiveFovRH( 60.f * ( float )M_PI / 180.f, float( _w ) / float( _h ), 0.1f, 1000.0f );

_lightView = XMMatrixLookAtRH(2.f * _worldLightDir, XMVectorZero(), XMVectorSet(0.f, 1.0f, 0.f, 0.f));
_lightView = XMMatrixLookAtRH(5.f * _worldLightDir, XMVectorZero(), XMVectorSet(0.f, 1.0f, 0.f, 0.f));

float monkeyAngle = float(fmod(time, 2 * M_PI));
_objects[1].model = XMMatrixScaling(0.65f, 0.65f, 0.65f) * XMMatrixRotationAxis(XMVectorSet(0.f, 1.0f, 0.f, 0.f), monkeyAngle) * XMMatrixTranslation(0.5f, 0.0f, 0.5f);
Expand Down

0 comments on commit a9d13aa

Please sign in to comment.