if (renderTargetId) { QRect rect(QPoint(0, 0), renderTargetSize); fboId = renderTargetId; renderer->setDeviceRect(rect); renderer->setViewportRect(rect); if (QQuickRenderControl::renderWindowFor(q)) { renderer->setProjectionMatrixToRect(QRect(QPoint(0, 0), size), false); renderer->setDevicePixelRatio(devicePixelRatio); } else { renderer->setProjectionMatrixToRect(QRect(QPoint(0, 0), rect.size()), false); renderer->setDevicePixelRatio(1); } } else { QSize pixelSize; QSizeF logicalSize; if (surfaceSize.isEmpty()) { pixelSize = size * devicePixelRatio; logicalSize = size; } else { pixelSize = surfaceSize; logicalSize = QSizeF(surfaceSize) / devicePixelRatio; } QRect rect(QPoint(0, 0), pixelSize); renderer->setDeviceRect(rect); renderer->setViewportRect(rect); const bool flipY = rhi ? !rhi->isYUpInNDC() : false; renderer->setProjectionMatrixToRect(QRectF(QPoint(0, 0), logicalSize), flipY); renderer->setDevicePixelRatio(devicePixelRatio); }
renderer->setProjectionMatrixToRect(QRectF(QPoint(0, 0), logicalSize), flipY);
C++ (Qt)renderer->setProjectionMatrixToRect(QRectF(QPoint(0, 0), logicalSize), flipY);auto matrix = renderer->projectionMatrix();matrix.rotate(90.0f, 1.0f, 0.0f); // не уверен какой вектор тут использоватьrenderer->setProjectionMatrix(matrix);
C++ (Qt)matrix.rotate(10.0f, 0.0f, 0.0f, 1.0f);
QMatrix4x4 matrix; matrix.ortho(rect.x(), rect.x() + rect.width(), flipY ? rect.y() : rect.y() + rect.height(), flipY ? rect.y() + rect.height() : rect.y(), 1, -1); setProjectionMatrix(matrix);
if (m_useDepthBuffer) { m_current_projection_matrix(2, 2) = m_zRange; m_current_projection_matrix(2, 3) = 1.0f - e->order * m_zRange; }
QMatrix4x4 matrix; matrix.ortho(rect.x(), rect.x() + rect.width(), rect.y() + rect.height(), rect.y(), 1, -1); matrix.rotate(90.0f, 0.0f, 0.0f, 1.0f); renderer->setProjectionMatrix(matrix);