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. Pick-to: 6.9 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>
This commit is contained in:
parent
5703548d49
commit
772873717a
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue