[CORE][CHG] Adapt to camera API change

This commit is contained in:
Linloir 2022-12-18 16:49:37 +08:00
parent 1dc9959936
commit db04a46510
No known key found for this signature in database
GPG Key ID: 58EEB209A0F2C366
2 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ void ModelThumbnailWidget::paintGL() {
_shaderProgram.bind(); _shaderProgram.bind();
glm::mat4 view = _camera.viewMatrix(); glm::mat4 view = _camera.viewMatrix();
glm::mat4 projection = glm::perspective(glm::radians(_camera.zoomVal()), (float)width() / (float)height(), 0.1f, 100.0f); glm::mat4 projection = _camera.projectionMatrix((float)width() / (float)height());
_shaderProgram.setUniform("view", view); _shaderProgram.setUniform("view", view);
_shaderProgram.setUniform("projection", projection); _shaderProgram.setUniform("projection", projection);

View File

@ -120,7 +120,7 @@ void SceneViewer::paintGL() {
// Set view and projection matrices // Set view and projection matrices
glm::mat4 view = _camera.viewMatrix(); glm::mat4 view = _camera.viewMatrix();
glm::mat4 projection = glm::perspective(glm::radians(_camera.zoomVal()), (float)width() / (float)height(), 0.1f, 100.0f); glm::mat4 projection = _camera.projectionMatrix((float)width() / (float)height());
_shaderProgram.setUniform("view", view); _shaderProgram.setUniform("view", view);
_shaderProgram.setUniform("projection", projection); _shaderProgram.setUniform("projection", projection);
_shaderProgram.setUniform("viewPos", _camera.position()); _shaderProgram.setUniform("viewPos", _camera.position());