mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0026357: Visualization - Panning zooms view if aspect ratio > 1
This commit is contained in:
@@ -563,8 +563,18 @@ gp_Pnt Graphic3d_Camera::ConvertView2World (const gp_Pnt& thePnt) const
|
||||
gp_XYZ Graphic3d_Camera::ViewDimensions() const
|
||||
{
|
||||
// view plane dimensions
|
||||
Standard_Real aSizeY = IsOrthographic() ? myScale : (2.0 * Distance() * Tan (DTR_HALF * myFOVy));
|
||||
Standard_Real aSizeX = myAspect * aSizeY;
|
||||
Standard_Real aSize = IsOrthographic() ? myScale : (2.0 * Distance() * Tan (DTR_HALF * myFOVy));
|
||||
Standard_Real aSizeX, aSizeY;
|
||||
if (myAspect > 1.0)
|
||||
{
|
||||
aSizeX = aSize * myAspect;
|
||||
aSizeY = aSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
aSizeX = aSize;
|
||||
aSizeY = aSize / myAspect;
|
||||
}
|
||||
|
||||
// and frustum depth
|
||||
return gp_XYZ (aSizeX, aSizeY, myZFar - myZNear);
|
||||
|
Reference in New Issue
Block a user