mirror of https://github.com/qt/qtgraphs.git
Fix scaling of custom objects in widgetgraphgallery example
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 <sakaria.pouke@qt.io>
Reviewed-by: Niko Korkala <niko.korkala@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit 772873717a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
913330ab0d
commit
9d6edfb25b
|
|
@ -499,7 +499,7 @@ void SurfaceGraphModifier::toggleItemOne(bool show)
|
||||||
//! [11]
|
//! [11]
|
||||||
auto *item = new QCustom3DItem(":/data/oilrig.mesh",
|
auto *item = new QCustom3DItem(":/data/oilrig.mesh",
|
||||||
positionOne,
|
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),
|
QQuaternion::fromAxisAndAngle(0.f, 1.f, 0.f, 45.f),
|
||||||
color);
|
color);
|
||||||
//! [11]
|
//! [11]
|
||||||
|
|
@ -508,7 +508,7 @@ void SurfaceGraphModifier::toggleItemOne(bool show)
|
||||||
//! [12]
|
//! [12]
|
||||||
item = new QCustom3DItem(":/data/pipe.mesh",
|
item = new QCustom3DItem(":/data/pipe.mesh",
|
||||||
positionOnePipe,
|
positionOnePipe,
|
||||||
QVector3D(0.005f, 0.5f, 0.005f),
|
QVector3D(0.0025f, 0.25f, 0.0025f),
|
||||||
QQuaternion(),
|
QQuaternion(),
|
||||||
color);
|
color);
|
||||||
item->setShadowCasting(false);
|
item->setShadowCasting(false);
|
||||||
|
|
@ -542,13 +542,13 @@ void SurfaceGraphModifier::toggleItemTwo(bool show)
|
||||||
auto *item = new QCustom3DItem();
|
auto *item = new QCustom3DItem();
|
||||||
item->setMeshFile(":/data/oilrig.mesh");
|
item->setMeshFile(":/data/oilrig.mesh");
|
||||||
item->setPosition(positionTwo);
|
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->setRotation(QQuaternion::fromAxisAndAngle(0.f, 1.f, 0.f, 25.f));
|
||||||
item->setTextureImage(color);
|
item->setTextureImage(color);
|
||||||
m_graph->addCustomItem(item);
|
m_graph->addCustomItem(item);
|
||||||
item = new QCustom3DItem(":/data/pipe.mesh",
|
item = new QCustom3DItem(":/data/pipe.mesh",
|
||||||
positionTwoPipe,
|
positionTwoPipe,
|
||||||
QVector3D(0.005f, 0.5f, 0.005f),
|
QVector3D(0.0025f, 0.25f, 0.0025f),
|
||||||
QQuaternion(),
|
QQuaternion(),
|
||||||
color);
|
color);
|
||||||
item->setShadowCasting(false);
|
item->setShadowCasting(false);
|
||||||
|
|
@ -577,7 +577,7 @@ void SurfaceGraphModifier::toggleItemThree(bool show)
|
||||||
auto *item = new QCustom3DItem();
|
auto *item = new QCustom3DItem();
|
||||||
item->setMeshFile(":/data/refinery.mesh");
|
item->setMeshFile(":/data/refinery.mesh");
|
||||||
item->setPosition(positionThree);
|
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->setRotation(QQuaternion::fromAxisAndAngle(0.f, 1.f, 0.f, 75.f));
|
||||||
item->setTextureImage(color);
|
item->setTextureImage(color);
|
||||||
m_graph->addCustomItem(item);
|
m_graph->addCustomItem(item);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue