Skip to content

Commit

Permalink
[core.matrix_transform] fixed a bug where orthographic matrices were …
Browse files Browse the repository at this point in the history
…incorrect.
  • Loading branch information
harrand committed Feb 24, 2024
1 parent 60c7baf commit 176615f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/tz/core/matrix_transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ namespace tz
m(1, 1) = 2.0f / (top - bottom);
m(2, 2) = -2.0f / (farval - nearval);

mat4::Row& bottom_row = m[2];
mat4::Row& bottom_row = m[3];
bottom_row[0] = -(right + left) / (right - left);
bottom_row[1] = -(top + bottom) / (top - bottom);
bottom_row[2] = -(farval + nearval) / (farval - nearval);
Expand Down
8 changes: 4 additions & 4 deletions src/tz/dbgui/dbgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,10 @@ namespace tz::dbgui
TopazShaderRenderData& shader_data = renderer.get_resource(global_render_data->shader_data_buffer)->data_as<TopazShaderRenderData>().front();
const ImGuiIO& io = ImGui::GetIO();
shader_data.vp = tz::orthographic(
0,
io.DisplaySize.x,
0,
io.DisplaySize.y,
-io.DisplaySize.x * 0.5f,
io.DisplaySize.x * 0.5f,
-io.DisplaySize.y * 0.5f,
io.DisplaySize.y * 0.5f,
-0.1f,
0.1f
) * tz::view(tz::vec3{io.DisplaySize.x * 0.5f, io.DisplaySize.y * 0.5f, 0.0f}, {});
Expand Down

0 comments on commit 176615f

Please sign in to comment.