Set fov and clip planes before viewpoint so zoom extents is correct.

This commit is contained in:
Leonardo Zide 2020-12-13 17:10:25 -08:00
parent fd92710cf8
commit 9a7e256c72

View file

@ -718,6 +718,19 @@ bool lcApplication::Initialize(QList<QPair<QString, bool>>& LibraryPaths, bool&
} }
else else
{ {
ActiveView->SetProjection(Orthographic);
if (SetFoV)
ActiveView->GetCamera()->m_fovy = FoV;
if (SetZPlanes)
{
lcCamera* Camera = ActiveView->GetCamera();
Camera->m_zNear = ZNear;
Camera->m_zFar = ZFar;
}
if (!ViewpointName.isEmpty()) if (!ViewpointName.isEmpty())
{ {
if (ViewpointName == QLatin1String("front")) if (ViewpointName == QLatin1String("front"))
@ -756,19 +769,6 @@ bool lcApplication::Initialize(QList<QPair<QString, bool>>& LibraryPaths, bool&
lcVector3(CameraPosition[3], CameraPosition[4], CameraPosition[5]), lcVector3(CameraPosition[3], CameraPosition[4], CameraPosition[5]),
lcVector3(CameraPosition[6], CameraPosition[7], CameraPosition[8])); lcVector3(CameraPosition[6], CameraPosition[7], CameraPosition[8]));
} }
ActiveView->SetProjection(Orthographic);
if (SetFoV)
ActiveView->GetCamera()->m_fovy = FoV;
if (SetZPlanes)
{
lcCamera* Camera = ActiveView->GetCamera();
Camera->m_zNear = ZNear;
Camera->m_zFar = ZFar;
}
} }
if (SaveImage) if (SaveImage)