From 9d6edfb25b5960855c0c3a06758503d67e5e12e7 Mon Sep 17 00:00:00 2001 From: Tomi Korpipaa Date: Wed, 12 Feb 2025 07:16:32 +0200 Subject: [PATCH] Fix scaling of custom objects in widgetgraphgallery example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Custom object scaling had a bug before 6.9 which made them 2 times too small by default. Adjust scaling in the example to take that into account. Change-Id: I0b3bfa4fe8606394765372d96d19f4c82e63087e Reviewed-by: Sakaria Pouke Reviewed-by: Niko Korkala Reviewed-by: Tomi Korpipää (cherry picked from commit 772873717ada9838d4fc50f153e72b28eeaa7fa1) Reviewed-by: Qt Cherry-pick Bot --- .../3d/widgetgraphgallery/surfacegraphmodifier.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/graphs/3d/widgetgraphgallery/surfacegraphmodifier.cpp b/examples/graphs/3d/widgetgraphgallery/surfacegraphmodifier.cpp index 496fb2f2..def44123 100644 --- a/examples/graphs/3d/widgetgraphgallery/surfacegraphmodifier.cpp +++ b/examples/graphs/3d/widgetgraphgallery/surfacegraphmodifier.cpp @@ -499,7 +499,7 @@ void SurfaceGraphModifier::toggleItemOne(bool show) //! [11] auto *item = new QCustom3DItem(":/data/oilrig.mesh", positionOne, - QVector3D(0.025f, 0.025f, 0.025f), + QVector3D(0.0125f, 0.0125f, 0.0125f), QQuaternion::fromAxisAndAngle(0.f, 1.f, 0.f, 45.f), color); //! [11] @@ -508,7 +508,7 @@ void SurfaceGraphModifier::toggleItemOne(bool show) //! [12] item = new QCustom3DItem(":/data/pipe.mesh", positionOnePipe, - QVector3D(0.005f, 0.5f, 0.005f), + QVector3D(0.0025f, 0.25f, 0.0025f), QQuaternion(), color); item->setShadowCasting(false); @@ -542,13 +542,13 @@ void SurfaceGraphModifier::toggleItemTwo(bool show) auto *item = new QCustom3DItem(); item->setMeshFile(":/data/oilrig.mesh"); item->setPosition(positionTwo); - item->setScaling(QVector3D(0.025f, 0.025f, 0.025f)); + item->setScaling(QVector3D(0.0125f, 0.0125f, 0.0125f)); item->setRotation(QQuaternion::fromAxisAndAngle(0.f, 1.f, 0.f, 25.f)); item->setTextureImage(color); m_graph->addCustomItem(item); item = new QCustom3DItem(":/data/pipe.mesh", positionTwoPipe, - QVector3D(0.005f, 0.5f, 0.005f), + QVector3D(0.0025f, 0.25f, 0.0025f), QQuaternion(), color); item->setShadowCasting(false); @@ -577,7 +577,7 @@ void SurfaceGraphModifier::toggleItemThree(bool show) auto *item = new QCustom3DItem(); item->setMeshFile(":/data/refinery.mesh"); item->setPosition(positionThree); - item->setScaling(QVector3D(0.04f, 0.04f, 0.04f)); + item->setScaling(QVector3D(0.02f, 0.02f, 0.02f)); item->setRotation(QQuaternion::fromAxisAndAngle(0.f, 1.f, 0.f, 75.f)); item->setTextureImage(color); m_graph->addCustomItem(item);