Skip to content

Commit fa05510

Browse files
committed
#3649 Incorrect camera aspec ratio
Everything else uses width/height ratio
1 parent 88aa94f commit fa05510

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

indra/newview/llgltfmaterialpreviewmgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ bool LLGLTFPreviewTexture::render()
462462
// Set up camera and viewport
463463
const LLVector3 origin(0.0, 0.0, 0.0);
464464
camera.lookAt(origin, object_position);
465-
camera.setAspect((F32)(mFullHeight / mFullWidth));
465+
camera.setAspect((F32)(mFullWidth / mFullHeight));
466466
const LLRect texture_rect(0, mFullHeight, mFullWidth, 0);
467467
camera.setPerspective(NOT_FOR_SELECTION, texture_rect.mLeft, texture_rect.mBottom, texture_rect.getWidth(), texture_rect.getHeight(), false, camera.getNear(), MAX_FAR_CLIP*2.f);
468468

indra/newview/llterrainpaintmap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ bool LLTerrainPaintMap::bakeHeightNoiseIntoPBRPaintMapRGB(const LLViewerRegion&
107107
const LLVector3 region_center = LLVector3(region_half_width, region_half_width, 0.0) + region.getOriginAgent();
108108
const LLVector3 camera_origin = LLVector3(0.0f, 0.0f, region_camera_height) + region_center;
109109
camera.lookAt(camera_origin, region_center, LLVector3::y_axis);
110-
camera.setAspect(F32(scratch_target.getHeight()) / F32(scratch_target.getWidth()));
110+
camera.setAspect(F32(scratch_target.getWidth()) / F32(scratch_target.getHeight()));
111111
const LLRect texture_rect(0, scratch_target.getHeight(), scratch_target.getWidth(), 0);
112112
glViewport(texture_rect.mLeft, texture_rect.mBottom, texture_rect.getWidth(), texture_rect.getHeight());
113113
// Manually get modelview matrix from camera orientation.

0 commit comments

Comments
 (0)