Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/vcpkg/test/vcpkg-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{
"kind": "git",
"repository": "https://github.com/cppfw/vcpkg-repo/",
"baseline": "a890a58ade57ae341232c8aeb9e3e0347f695f89",
"baseline": "9fda5016dcd22857de5dd20702428ac8d1652a99",
"reference": "main",
"packages": [
"myci",
Expand Down
7 changes: 6 additions & 1 deletion src/ruis/render/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ class context : public std::enable_shared_from_this<context>
/**
* @brief Initial matrix to use for rendering.
* The initial coordinate system is right-handed.
* The initial matrix makes viewport edges to be: left = 0, right = 1, top = 0, bottom = 1.
*
* Convention: NDC (normalized device coordinates) spans x, y, z from [0, 1],
* x-axis right, y-axis down, z-axis away from the viewer. With the initial_matrix:
* x = 0 maps to the left viewport edge, x = 1 to the right viewport edge;
* y = 0 maps to the top viewport edge, y = 1 to the bottom viewport edge;
* z = 0 maps to the near clipping plane, z = 1 to the far clipping plane.
*/
const r4::matrix4<float> initial_matrix;

Expand Down
4 changes: 1 addition & 3 deletions tests/app1/src/cube_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ void cube_widget::update(uint32_t dt)
void cube_widget::render(const ruis::mat4& matrix) const
{
ruis::mat4 matr(matrix);
matr.scale(this->rect().d / 2);
matr.translate(1, 1);
matr.scale(1, -1, -1); // y down, z away
matr.scale(this->rect().d);
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
matr.frustum(-2, 2, -1.5, 1.5, 2, 100);
matr.translate(0, 0, -4);
Expand Down
Loading